首先看看这个代码:
<div class='btn-group'> <button type='button' class='btn'>计算机</button> <button type='button' class='btn'>网络</button> <button type='button' class='btn'>桌面项目</button> </div>
将功能相近的按钮分成一组,bootstrap 为我们设定了该组的样式
如图:
还可以进行更加复杂的分组
<div class='btn-toolbar'> <div class='btn-group'> <button type='button' class='btn'>计算机</button> <button type='button' class='btn'>网络</button> <button type='button' class='btn'>桌面项目</button> </div> <div class='btn-group'> <button type='button' class='btn'>按钮一</button> <button type='button' class='btn'>按钮二</button> <button type='button' class='btn'>按钮三</button> </div> </div>
如图:
使用这种方法可以为网站创建复杂的工具栏