gpt4 book ai didi

javascript - Bootstrap Dropdown - 移动其他内容

转载 作者:行者123 更新时间:2023-11-30 12:30:13 25 4
gpt4 key购买 nike

<!DOCTYPE html>
<!-- saved from url=(0073)http://tutsme-webdesign.info/tutorials/navs/pills_stacked_panesright.html -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Bootstrap 3 Navs Tabs Pills</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Bootstrap core CSS -->
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0-rc2/css/bootstrap.css" rel="stylesheet" media="screen">


<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.2.0/respond.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<ul class="nav nav-pills nav-stacked" data-toggle="collapse">
<li class="dropdown">
<a href="" data-toggle="dropdown" class="dropdown-toggle"><span class="glyphicon glyphicon-tree-deciduous"> Nachbarschaft </span><b class="caret"></b></a>
<ul class="dropdown-menu">
<li role="presentation"><a href="#hoodProfile">Profil</a></li>
<li role="presentation"><a href="#neighbours">Nachbarn</a></li>
</ul>
</li>
<li role="presentation"><a href="#quests"><span class="glyphicon glyphicon-tasks"> Aufgaben</span></a></li>
</ul>
</div><!-- end of container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</body>
</html>

如何让第一个药丸的下拉菜单使下面的药丸向下移动?所以当我点击下拉菜单时,我仍然可以看到下方的药丸“Aufgaben”?

JSFiddle 示例:http://jsfiddle.net/o0xutq34/(基于 http://tutsme-webdesign.info/tutorials/navs/pills_stacked_panesright.html )

提前致谢!

最佳答案

您需要使下拉 div 静态定位(不是绝对定位)并从中删除 float :

.container .dropdown-menu {
position: static;
float: none;
}

演示:http://jsfiddle.net/o0xutq34/1/

关于javascript - Bootstrap Dropdown - 移动其他内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27973549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com