使用Bootstrap将下拉菜单添加到按钮
要将下拉菜单添加到按钮,只需将按钮和下拉菜单包装在即可。btn-group。
您可以尝试运行以下代码以将下拉菜单添加到按钮-
示例
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<link href = "/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src = "/scripts/jquery.min.js"></script>
<script src = "/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class = "btn-group">
<button type = "button" class = "btn btn-default dropdown-toggle" data-toggle = "dropdown">
Default
<span class = "caret"></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>
<div class = "btn-group">
<button type = "button" class = "btn btn-primary dropdown-toggle" data-toggle = "dropdown">
Primary
<span class = "caret"></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>
</body>
</html>热门推荐
10 同学分开祝福语简短
11 生日寿宴祝福语简短精辟
12 对同事简短生日祝福语
13 新年祝福语简短的个性
14 新年的好祝福语简短
15 送礼祝福语男性生日简短
16 哥哥祝福语简短霸气句子
17 送离别同事简短祝福语
18 岁岁祝福语简短独特