twitter-bootstrap 引导程序中其他 div 下方的 div
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22633279/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Div below other div in bootstrap
提问by Hitesh
I know this is kind of silly question but i m stuck with this for nearly 4 hours.I am new to bootstrap i m building a website for mobile view(and can also be viewed from desktop) using asp.net.I want a menu with collapse functionality in mobile i m using a div with class="navbar navbar-fixed-top" now i want another div that should come after this div.Here is my code
我知道这是一个愚蠢的问题,但我坚持了将近 4 个小时。我是新手,我正在使用 asp.net 构建一个用于移动视图的网站(也可以从桌面查看)。我想要一个折叠菜单移动即时消息中的功能使用 class="navbar navbar-fixed-top" 的 div 现在我想要另一个 div 应该在这个 div 之后。这是我的代码
<div class="navbar navbar-fixed-top"><!--First div-->
<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="#">Project name</a>
<div class="nav-collapse">
<ul class="nav">
<li ><a href="#">Home</a></li>
<li class="active"><a href="GridView.aspx">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div id="Second"> <h2 style="text-align:center;">I want this div to come after the above div</h2></div>
This gives proper output when i view in mobile but when i run in desktop i am not able to see the Second div.
当我在移动设备中查看时,这会提供正确的输出,但是当我在桌面上运行时,我看不到第二个 div。
Thanks
谢谢
回答by Murali Murugesan
specify a bootstrap class rowor row-fluid
指定一个引导类row或row-fluid
<div id="Second" class="row">
</div>
回答by KoernerWS
Solution: Additional-CSS. Because navbar is position: absolute.
解决方案:附加 CSS。因为导航栏是position: absolute.
#Second {
margin-top: 80px;
}

