bootstrap笔记
bootstrap官方文档地址:
http://getbootstrap.com/
要想熟练掌握bootstrap,需要对官方文档很熟悉。
添加的默认的导航栏,删除掉了里面多余的内容,改颜色或位置的时候只需要改class即可。
导航栏居顶且没有圆角:navbar-fixed-top
内容居中:添加class为container的div
需要添加多列内容的时候需要用到栅格系统。
html的双箭头实体:»
分割线:<hr>
仿照bootstrap官方给的例子的实现:
1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="UTF-8"> 5 <title></title> 6 <link rel="stylesheet" href="bootstrap.min.css" type="text/css"> 7 </head> 8 <body> 9 <nav class="navbar navbar-inverse navbar-fixed-top"> 10 <div class="container"> 11 <!-- Brand and toggle get grouped for better mobile display --> 12 <div class="navbar-header"> 13 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> 14 <span class="sr-only">Toggle navigation</span> 15 <span class="icon-bar"></span> 16 <span class="icon-bar"></span> 17 <span class="icon-bar"></span> 18 </button> 19 <a class="navbar-brand" href="#">Project name</a> 20 </div> 21 22 <!-- Collect the nav links, forms, and other content for toggling --> 23 <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 24 <form class="navbar-form navbar-right" role="search"> 25 <div class="form-group"> 26 <input type="text" class="form-control" placeholder="Email"> 27 <input type="text" class="form-control" placeholder="Password"> 28 </div> 29 <button type="submit" class="btn btn-success">Sign in</button> 30 </form> 31 </div><!-- /.navbar-collapse --> 32 </div><!-- /.container-fluid --> 33 </nav> 34 <div class="jumbotron"> 35 <div class="container"> 36 <br> 37 <h1>Hello, world!</h1> 38 <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p> 39 <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p> 40 </div> 41 </div> 42 <div class="container"> 43 <div class="row"> 44 <div class="col-md-4"> 45 <h1>Heading</h1> 46 <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> 47 <button type="button" class="btn btn-default">Default »</button> 48 </div> 49 <div class="col-md-4"> 50 <h1>Heading</h1> 51 <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> 52 <button type="button" class="btn btn-default">Default »</button> 53 </div> 54 <div class="col-md-4"> 55 <h1>Heading</h1> 56 <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> 57 <button type="button" class="btn btn-default">Default »</button> 58 </div> 59 </div> 60 </div> 61 <div class="container"> 62 <hr> 63 <p>© 2015 Company, Inc.</p> 64 </div> 65 66 </body> 67 </html>
效果:http://1.yidongceshi.sinaapp.com/bootstrap/example.html