bootstrap框架、导航条、下拉菜单、轮播广告carousel、栅格系统布局、标签页tabs、模态框、菜单定位的个人总结,具体详情如下所示:
bootstrap框架
<!DOCTYPE html> <html lang="zh-cn"><> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"><> <title>Bootstrap</title> <> <link href="css/bootstrap.min.css" rel="stylesheet"> <> <> <!--[if lt IE 9]> <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> </head> <body> <h1>你好</h1> <> <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> <> <script src="js/bootstrap.min.js"></script> </body> </html>
导航
<nav role="navigation"><> <div><> <div> <> <button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span>Toggle navigation</span> <span></span> <span></span> <span></span> </button> <> <a href="#">Brand</a> </div> <div id="bs-example-navbar-collapse-1"><> <> <ul> <li><a href="#">a</a></li> <li><a href="#">a</a></li> </ul> </div> </div> </nav>
.navbar-inverse:改变导航条的背景颜色
.container:居中显示
固定导航条会遮盖页面内容,解决办法设置body的*padding-top*
下拉菜单
<li> <a href="#" data-toggle="dropdown">下拉菜单<span></span></a> <ul role="menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else</a></li> <li></li> <li><a href="#">linkkk/a></li> </ul> </li>
data属性API可以使用所有的Bootstrap插件
轮播广告(carousel)
<div id="carousel-example-generic" data-ride="carousel"> <> <ol> <li data-target="#carousel-example-generic" data-slide-to="0"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <> <div role="listbox"> <div> <img src="…"> <div>……</div> </div> <div> <img src="…"> <div>……</div> </div> </div> <> <a href="#carousel-example-generic" role="button" data-slide="prev"> <span></span> <pan>previous</span> </a> <a href="#carousel-example-generic" role="button" data-slide="next"> <span></span> <pan>Next</span> </a> </div>
.data-slide-to索引,指向轮播广告的内容,从0开始
.carousel设置广告框的样式(高度、背景色)
.carousel .item设置广告框的样式(高度、背景色)
栅格系统布局
<div> <div> <div>.col-md-4</div> <div>.col-md-4</div> <div>.col-md-4</div> </div> </div>
标签页tabs
<> <ul role="tablist"> <li><a href="#home" role="tab" data-toggle="tab">Home</a></li> <li><a href="#profile" role="tab" data-toggle="tab">Profile</a></li> <li><a href="#messages" role="tab" data-toggle="tab">Messages</a></li> <li><a href="#settings" role="tab" data-toggle="tab">Settings</a></li> </ul> <> <div> <div id="home">…</div> <div id="profile">…</div> <div id="messages">…</div> <div id="settings">…</div> </div>
标签页tabs
<div> <div> <div> <> <div> <button type="button" data-dismiss="modal"> <span aria-hidden="true">×</span> <span>Close</span> <h4>Modal title</h4> </button> </div> <> <div> … </div> <> <div> <button type="button" data-dismiss="modal">Close</button> <button type="button" data-dismiss="modal">Save</button> </div> </div> </div> </div>
以上所述是小编给大家介绍的BootStrap框架个人总结(bootstrap框架、导航条、下拉菜单、轮播广告carousel、栅格系统布局、标签页tabs、模态框、菜单定位),希望对大家有所帮助,如果大家有任何疑问请给我们留言,小编会及时回复大家的。在此也非常感谢大家对查字典教程网的支持!
【BootStrap框架个人总结(bootstrap框架、导航条、下拉菜单、轮播广告carousel、栅格系统布局、标签页tabs、模态框、菜单定位)】相关文章: