1.3.4,下拉菜单导航
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <ul class="nav nav-tabs"> ... <li role="presentation" class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"> Dropdown <span class="caret"></span> </a> <ul class="dropdown-menu"> <li><a href="#">购物车</a></li> <li><a href="#">我的订单</a></li> <li><a href="#">联系客服</a></li> </ul> </li> ... </ul> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
1.3.5,综合导航栏
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <div> <!-- 综合导航栏 --> <nav class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Brand</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> </div> </div> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
1.3.6,顶部导航栏
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <div> <!-- 固定在顶部 --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Brand</a></li> <li><a href="#">Home</a></p></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> </div> </nav> </div> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
1.3.7,底部导航栏
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <div> <!-- 固定在底部 --> <nav class="navbar navbar-default navbar-fixed-bottom"> <div class="container"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Brand</a></li> <li><a href="#">Home</a></p></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> </div> </nav> </div> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
1.4,下拉框
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <!-- 下拉框 --> <div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> Dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </div> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
1.5,搜索框
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <br> <br> <div> <!-- 搜索框 --> <div class="input-group"> <input type="text" class="form-control" placeholder="请输入要搜索的内容"> <span class="input-group-addon">百度一下</span> </div> </div> <hr> <div> <div class="input-group"> <input type="text" class="form-control" placeholder="请输入要搜索的内容"> <span class="input-group-btn"> <button class="btn btn-primary" type="button">百度一下</button> </span> </div> </div> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
二,分页
2.1,默认分页
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <nav aria-label="Page navigation"> <ul class="pagination"> <li> <a href="#" aria-label="Previous"> <span aria-hidden="true">«</span> </a> </li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li> <a href="#" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li> </ul> </nav> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
2.2,翻页
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <nav aria-label="..."> <ul class="pager"> <li><a href="#">上一页</a></li> <li><a href="#">下一页</a></li> </ul> </nav> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
翻页只能实现上一页和下一页的简单翻页,其常用于博客和杂志等简单站点
2.3,对齐翻页
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>测试</title> <link rel="stylesheet" href="../css/bootstrap.min.css"> </head> <body> <nav aria-label="..."> <ul class="pager"> <li class="previous"><a href="#"><span aria-hidden="true">←</span> 上一页</a></li> <li class="next"><a href="#">下一页 <span aria-hidden="true">→</span></a></li> </ul> </nav> </body> <script src="../js/jquery.js"></script> <script src="../js/bootstrap.min.js"></script> </html>
最后
最后送大家一句司汤达的一句话:一个人只要强烈地坚持不懈地追求,他就能达到目的。