转载请标明http://blog.csdn.net/kylinhao/article/details/46813737
一直想随便写写,但是太懒,想到哪就写到哪吧
详情参考
1. w3c bootstrap教程 http://www.runoob.com/bootstrap/bootstrap-tutorial.html
2. 官网教程 http://v3.bootcss.com/components/
首先Boostrap设置了很多的格式可以让元素的style看起来更漂亮,但是Boostrap的很多样式并没有做成一个合适的文档,所以有时候找的比较麻烦。
下面找一些常用的元素使用bootstrap
1. input text
<label>新密码:</label>
<input type="password" name="pwd" class="form-control">
这样写了后会发现它们不再一行
这是因为form-control 对input的控制是width:100%;display: block;
让他们在一行显示只需要设置下width和display即可,举个例子
.form-control {
width: 300px;
display: inline-block;
margin: 5px 5px 5px 20px;
}
2.table
基本使用
<table class="table table-bordered table-hover" >
</table>
3.panel
这个看起来还可以
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">title</h3>
</div>
<div class="panel-body">
body
</div>
</div>
4.fieldset
<fieldset>
<legend>title</legend>
<div>
body
</div>
</fieldset>