每个人的成功之路可能有所不同,但我相信成功需要每个想要成功的人人民努力奋斗和奋斗,通往成功的每条道路都是坎s曲折。
Bootstrap提供了对分页的良好支持。
0x01 默认的分页
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="nofollow noopener noreferrer" href="../../css/bootstrap.min.css" rel="stylesheet"> <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> <script src="../../js/bootstrap.min.js"></script> <title>默认的分页</title> </head> <body> <div class="container"> <div class="page-header"> <h1>默认的分页</h1> </div> <div> <ul class="pagination"> <li class="disabled"><a rel="nofollow noopener noreferrer" href="#">«</a></li> <li class="active"><a rel="nofollow noopener noreferrer" href="#">1</a></li> <li><a rel="nofollow noopener noreferrer" href="#">2</a></li> <li><a rel="nofollow noopener noreferrer" href="#">3</a></li> <li><a rel="nofollow noopener noreferrer" href="#">4</a></li> <li><a rel="nofollow noopener noreferrer" href="#">5</a></li> <li><a rel="nofollow noopener noreferrer" href="#">»</a></li> </ul> </div> </div> </body> </html>
效果如下:
上面增加了disabled和active的效果。
0x02 综合案例
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="nofollow noopener noreferrer" href="../../css/bootstrap.min.css" rel="stylesheet"> <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> <script src="../../js/bootstrap.min.js"></script> <title>分页</title> </head> <body> <div class="container"> <div class="page-header"> <h1>分页</h1> </div> <div> <ul class="pagination"> <li class="disabled"><a rel="nofollow noopener noreferrer" href="#">«</a></li> <li class="active"><a rel="nofollow noopener noreferrer" href="#">1</a></li> <li><a rel="nofollow noopener noreferrer" href="#">2</a></li> <li><a rel="nofollow noopener noreferrer" href="#">3</a></li> <li><a rel="nofollow noopener noreferrer" href="#">4</a></li> <li><a rel="nofollow noopener noreferrer" href="#">5</a></li> <li><a rel="nofollow noopener noreferrer" href="#">»</a></li> <li></li> <li> <label for="text">跳转到:</label><input type="text" class="text-info" id="text" size="10"> </li> <li> <button class="btn btn-primary">Go</button> </li> </ul> </div> </div> </body> </html>
效果如下:
0x03 翻页
下面的例子演示.pager的样式:
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="nofollow noopener noreferrer" href="../../css/bootstrap.min.css" rel="stylesheet"> <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> <script src="../../js/bootstrap.min.js"></script> <title>翻页</title> </head> <body> <div class="container"> <div class="page-header"> <h1>翻页</h1> </div> <div> <ul class="pager"> <li class="previous"><a rel="nofollow noopener noreferrer" href="#">前一页</a></li> <li class="next"><a rel="nofollow noopener noreferrer" href="#">后一页</a></li> </ul> </div> </div> </body> </html>
效果如下:
如果大家还想深入学习,可以点击这里进行学习,再为大家附3个精彩的专题:
Bootstrap学习好代码教程
Bootstrap实战好代码教程
Bootstrap插件使用好代码教程
以上就是Bootstrap基本组件学习笔记之分页(12)。人生能有几回搏,此时不搏何时搏!更多关于Bootstrap基本组件学习笔记之分页(12)请关注haodaima.com其它相关文章!