我有这个代码
<div class="btn-group" dropdown>
<button type="button" class="btn btn-danger">Action</button>
<button type="button" class="btn btn-danger dropdown-toggle" dropdown-toggle>
<span class="caret"></span>
<span class="sr-only">Split button!</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
看起来像
我想像这样添加Text的cog insteaqd之类的图标
我试过了
<button type="button" class="glyphicon glyphicon-cog"></button>
但是不起作用
对于按钮,图标需要放在按钮内部作为按钮的内容,因此<button type="button" class="glyphicon glyphicon-cog"></button>
应该
<button type="button" class="btn">
<span class="glyphicon glyphicon-cog"></span>
</button>
编辑:在Bootstrap中添加插入符号,您可以使用 <span class="caret"></span>
因此,获得带有齿轮和下拉式插入符号的按钮的最终结果是:
<button type="button" class="btn">
<span class="glyphicon glyphicon-cog"></span><span class="caret"></span>
</button>
当我将该代码粘贴到Bootstrap的主页中时,得到以下信息:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句