bootstrap实现二级下拉菜单效果
作者:l_zhao1213 时间:2024-04-17 10:40:42
本文实例为大家分享了bootstrap实现二级下拉菜单展示的具体代码,供大家参考,具体内容如下
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 实例 - 基本的按钮下拉菜单</title>
<link href=http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<style type="text/css">
.dropdown-submenu {
position: relative;
}
.dropdown-submenu > .dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover > a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left > .dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
</style>
</head>
<body>
<div class="btn-group">
<button type="button" class="btn btn-default">原始</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
<li><a href="#">另一个功能</a></li>
<li><a href="#">其他</a></li>
<li class="divider"></li>
<li class="dropdown-submenu">
<a href="#">More options </a>
<ul class="dropdown-menu">
<li>
<a href="#">另一个功能1</a>
</li>
</ul>
</li>
</ul>
</div>
</body>
</html>
如果大家还想深入学习,可以点击这里进行学习,再为大家附3个精彩的专题:
Bootstrap学习教程
Bootstrap实战教程
Bootstrap Table使用教程
Bootstrap插件使用教程
来源:http://blog.csdn.net/l_zhao1213/article/details/51324451
标签:bootstrap,下拉菜单
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
MySQL数据库约束详解
2024-01-24 14:41:01
![](https://img.aspxhome.com/file/2023/1/69761_0s.png)
golang协程设计及调度原理
2024-02-21 21:16:51
![](https://img.aspxhome.com/file/2023/1/103071_0s.png)
VUE写一个简单的表格实例
2023-07-02 16:56:30
![](https://img.aspxhome.com/file/2023/7/139837_0s.png)
Python基本数据类型之字符串str
2021-06-03 22:47:31
JavaScript,5种调用函数的方法[译]
2009-02-24 16:26:00
基于python traceback实现异常的获取与处理
2022-04-05 09:59:32
五个Python迷你版小程序附代码
2023-09-28 02:55:26
![](https://img.aspxhome.com/file/2023/7/95927_0s.png)
Python 给屏幕打印信息加上颜色的实现方法
2022-10-27 08:00:08
![](https://img.aspxhome.com/file/2023/4/133884_0s.png)
使用sysbench来测试MySQL性能的详细教程
2024-01-14 14:33:54
Python中for循环详解
2021-06-22 18:41:56
php反序列化之魔术方法超详细讲解
2023-11-16 07:24:59
![](https://img.aspxhome.com/file/2023/1/55621_0s.png)
SQL事务用法begin tran,commit tran和rollback tran的用法
2012-01-05 18:58:51
HTML 5 预览
2008-01-24 12:17:00
![](https://img.aspxhome.com/file/UploadPic/20081/24/2008124122637981s.gif)
MySQL中如何定义外键
2010-03-09 16:18:00
倾斜的鼠标翻转导航制作上的烦恼
2007-06-20 16:39:00
![](https://img.aspxhome.com/file/uploadpic/20075/200751117416943.png)
element-UI el-table树形数据 修改小三角图标方式
2023-07-02 17:09:53
![](https://img.aspxhome.com/file/2023/9/139959_0s.png)
Python通过Tesseract库实现文字识别
2023-02-28 13:29:46
![](https://img.aspxhome.com/file/2023/8/100828_0s.png)
PHP中集成PayPal标准支付的实现方法分享
2023-09-06 09:11:22
![](https://img.aspxhome.com/file/2023/0/55650_0s.gif)
详解Python读取和写入操作CSV文件的方法
2021-03-01 23:13:43
![](https://img.aspxhome.com/file/2023/6/65526_0s.jpg)
python+Django+pycharm+mysql 搭建首个web项目详解
2024-01-18 22:18:07
![](https://img.aspxhome.com/file/2023/3/76143_0s.jpg)