gpt4 book ai didi

twitter-bootstrap - 汉堡菜单与导航栏断开连接

转载 作者:太空宇宙 更新时间:2023-11-04 10:05:55 25 4
gpt4 key购买 nike

当我打开菜单时,我试图让导航栏直接位于移动 View 中汉堡包菜单按钮的下方。但现在它在图像下方,看起来不连贯。

我怎样才能让它位于汉堡包按钮下方?

切换导航

    <!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li><a href="#">Mission</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Staff</a></li>
<li><a href="#">Testimonials</a></li>
</ul>
</div>
</nav>

https://jsfiddle.net/xbemtom0/4/

最佳答案

只需在该作品下方添加,图像 div 存在放置问题。

<div class="row collapse navbar-collapse" id="collapsemenu">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li ><a href="#">Mission</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Staff</a></li>
<li><a href="#">Testimonials</a></li>
</ul> </div>

<div class="row picture" >
<img src="http://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools.com"/>
</div>

</div>
</nav>

(或)

<nav class="nav navbar-default">
<ul class="nav navbar-nav top-right">
<li>Search</li>
<li>Language</li>
<li>Account</li>
<li>Bag</li>
</ul>
</nav>
<div class="container header">
<div class="row top-right-nav">

</div>

<div class="row picture" >
<img src="http://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools.com"/>
</div>

<nav class="navbar navbar-default">
<button type="button" class="navbar-toggle collapsed navbar-hamburger"
data-toggle="collapse"
data-target="#collapsemenu"
>
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="row collapse navbar-collapse" id="collapsemenu">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li ><a href="#">Mission</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Staff</a></li>
<li><a href="#">Testimonials</a></li>
</ul> </div>
</nav></div>

<div class="container">

<div class="row">


<h2>hi</h2>
</div><!-- row -->
</div><!-- content container -->

.top-right{
float:right;
}

关于twitter-bootstrap - 汉堡菜单与导航栏断开连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38012205/

25 4 0