码迷,mamicode.com
首页 > 其他好文 > 详细

(转)BootStrap改下拉菜单为悬停

时间:2018-10-25 10:58:50      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:pdo   导航条   head   实例   text   tst   query   play   rop   

将CSS修改为:

<style type="text/css">
.navbar .nav > li .dropdown-menu {
margin: 0;
}
.navbar .nav > li:hover .dropdown-menu {
display: block;
}
</style>

实例:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Bootstrap导航条鼠标悬停下拉菜单</title>
<link id="bootstrap_221" rel="stylesheet" type="text/css" class="library" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css">
<script id="jquery_172" type="text/javascript" class="library" src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
<script id="bootstrap_221" type="text/javascript" class="library" src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<style type="text/css">
.navbar .nav > li .dropdown-menu {
margin: 0;
}
.navbar .nav > li:hover .dropdown-menu {
display: block;
}
</style>
</head>
<body>
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<ul class="nav nav-pills">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown"><a href="#">SVN<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">sub SVN1</a></li>
<li><a href="#">sub SVN2</a></li>
</ul>
</li>
<li><a href="#">iOS</a></li>
<li><a href="#">VB.Net</a></li>
<li class="dropdown"><a href="#">Java<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">sub Java1</a></li>
<li><a href="#">sub Java2</a></li>
</ul>
</li>
<li><a href="#">PHP</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>

(转)BootStrap改下拉菜单为悬停

标签:pdo   导航条   head   实例   text   tst   query   play   rop   

原文地址:https://www.cnblogs.com/jicheng1996/p/9847575.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!