我使用twitter bootstrap来开发响应式CSS 你能告诉我如何使用水平方向而不是垂直方向的链接开发下拉菜单
请查看this页
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">
<img alt="change" class="defieLogo" src="http://www.defie.co/designerImages/defie_logo_only.png">
</a>
<div class="nav-collapse in collapse" style="height: auto;">
<ul class="nav">
<li class="active"><a href="/docs/examples/product.html">Product</a></li>
<li><a href="/docs/examples/solutions.html">Solutions</a></li>
<li><a href="/docs/examples/services.html">Services</a></li>
<li><a href="/docs/examples/partners.html">Partners</a></li>
<li><a href="/docs/examples/partners.html">Contact</a></li>
</ul>
<form class="navbar-form pull-right">
<input class="span2" type="text" placeholder="Email">
<input class="span2" type="password" placeholder="Password">
<button type="submit" class="btn">Sign in</button>
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
答案 0 :(得分:0)
不能直接确定这是否是您正在寻找的内容,因为它是点击下拉菜单而不是:悬停。单击“产品”导航项进行测试。
jsFiddle http://jsfiddle.net/AJ5JW/1/
的变化:
<li class="dropdown active"><a href="/docs/examples/product.html" class="dropdown-toggle" data-toggle="dropdown">Product</a>
<ul class="dropdown-menu">
<li><a href="http://">Hi1</a></li>
<li><a href="http://">Hi2</a></li>
<li><a href="http://">Hi3</a></li>
</ul>
</li>
从第1424行开始,垂直“移动”视图也转换得很好。
利用此http://twitter.github.com/bootstrap/components.html#navbar