<h3>下拉菜单</h3> <div> <button type="button" data-toggle="dropdown" aria-expanded="true"> Dropdown <span></span> </button> <ul role="menu" aria-labelledby="dropdownMenu1"> <li role="presentation"><a role="menuitem" tabindex="-1" href="#" >Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#" >Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#" >Something else here</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#" >Separated link</a></li> </ul> </div>
看一下效果:
2.4输入框
通过<input></input>标签去创建输入框。
<h3>输入框</h3> <div> <span></span> <input type="text" placeholder="username"> </div> <div> <span></span> <input type="password" placeholder="password"> </div>
效果图:
2.5导航栏
导航栏作为整个网站的指引必不可少。
<h3>导航栏</h3> <nav> <div> <ul> <li><a href="#" >Home</a></li> <li><a href="#about" >About</a></li> <li><a href="#contact" >Contact</a></li> <li> <a href="#" data-toggle="dropdown" role="button" aria-expanded="false">Dropdown <span></span></a> <ul role="menu"> <li><a href="#" >Action</a></li> <li><a href="#" >Another action</a></li> <li></li> <li>Nav header</li> <li><a href="#" >Separated link</a></li> </ul> </li> </ul> </div><!--/.nav-collapse --> </div> </nav>
效果呢↓
2.6表单
人与系统之间数据的传递都需要依靠表单来完成。比如注册/登录信息的提交,查询条件的提交等。用<form></form>标签来创建表单。
<h3>表单</h3> <form> <div> <span></span> <input type="email" placeholder="Enter email"> </div> <div> <span></span> <input type="password" placeholder="Password"> </div> <div> <label for="exampleInputFile">File input</label> <input type="file"> <p>Example block-level help text here.</p> </div> <div> <label> <input type="checkbox"> Check me out </label> </div> <button type="submit">Submit</button> </form>
效果如下:
2.7警告框
警告框是系统向用户传达信息和提供指引的重要手段。没有针对警告框的标签,通过bootstrap所提供的样式可以瞬间制作出漂亮的警告框。
<h3>警告框</h3> <div role="alert"> <button type="button" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <strong>Warning!</strong> Better check yourself, you're not looking too good. </div> <div role="alert"> <a href="#">success!</a> </div> <div role="alert"> <a href="#">info!</a> </div> <div role="alert"> <a href="#">warning!</a> </div> <div role="alert"> <a href="#">danger!</a> </div>
效果图:
2.8进度条
系统的处理过程往往需要用户等待,进度条可以让用户感知到系统的处理过程,从而增加容忍度。
<h3>进度条</h3> <div> <div role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100"> 70% </div> </div>
3、Bootstrap栅格系统
首先,我们先要了解什么是栅格系统!往下看 ↓