to make a more complex component.
<div class="btn-toolbar" role="toolbar">
<div class="btn-group">
<button type="button" class="btn btn-default">1</button>
<button type="button" class="btn btn-default">2</button>
<button type="button" class="btn btn-default">3</button>
<button type="button" class="btn btn-default">4</button>
<button type="button" class="btn btn-default">5</button>
<button type="button" class="btn btn-default">6</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default">7</button>
<button type="button" class="btn btn-default">8</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default">9</button>
</div>
</div>
button drop-down menus are basically the same as drop-down menus in appearance. the only difference between them is that the outer container div.dropdown is replaced by div.btn-group
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
按钮下拉菜单
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">菜单列表1</a></li>
<li><a href="#">菜单列表2</a></li>
<li><a href="#">菜单列表3</a></li>
<li><a href="#">菜单列表4</a></li>
<li><a href="#">菜单列表5</a></li>
</ul>
</div>
.btn-group .dropdown-toggle:active,
.btn-group.open .dropdown-toggle {
outline: 0;
}
.btn-group > .btn + .dropdown-toggle {
padding-right: 8px;
padding-left: 8px;
}
.btn-group > .btn-lg + .dropdown-toggle {
padding-right: 12px;
padding-left: 12px;
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow: none;
box-shadow: none;
}
the downward triangle of the button is created by adding a span tag element to the button tag, and the class name is .caret
this triangular form is implemented through css. the following is the bootstrap.css source code:
the above is the entire content of this article, i hope it will be helpful to everyone's study.