Bootstrap基本组件学习笔记之分页(12)
Bootstrap提供了对分页的良好支持。
0x01 默认的分页
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link 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 href="#">«</a></li> <li class="active"><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="#">»</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 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 href="#">«</a></li> <li class="active"><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="#">»</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 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 href="#">前一页</a></li> <li class="next"><a href="#">后一页</a></li> </ul> </div> </div> </body> </html>
效果如下:
如果大家还想深入学习,可以点击这里进行学习,再为大家附3个精彩的专题:
Bootstrap学习教程
Bootstrap实战教程
Bootstrap插件使用教程
相关推荐
opspider 2018-10-27
zxcasd 2018-10-27
jingtianyiyi 2016-01-06
AnneZhao 2015-11-17
zh000 2015-07-22
twtonrg 2013-11-17
DHCliaozheng 2017-03-12
twtonrg 2017-11-14
niepxiya 2017-08-07
乔乔 2017-06-28
前端分页相当简单,在我添加了2w条测试数据的时候打开的很流畅,没有卡顿。var d = '<button href="#" class="btn btn-default" mce_href="#&qu
相信未来 2017-05-18
DJPLH 2017-02-20
lixia 2016-12-28
程序员哦 2016-12-23
iChangebaobao 2016-12-23
Chinahdy 2016-12-23
相信未来 2016-11-07
iChangebaobao 2019-05-08