gpt4 book ai didi

html - Bootstrap 中损坏的导航栏折叠

转载 作者:行者123 更新时间:2023-11-28 06:20:42 24 4
gpt4 key购买 nike

我正在基于 bootstrap 制作新网站,但每次我点击按钮时 navbar-collapsed 它都会崩溃,我也想得到它应该在的位置(在底部导航栏)和 Logo 中间的折叠按钮,但我无法弄明白 collapse not working properly

HTML

<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Zobrazit navigaci</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html"><img src="logo.png" width="50px" height="50px"></a>
</div>
<!-- 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 navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Škola <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="portfolio-1-col.html">Výroční zprávy</a>
</li>
<li>
<a href="portfolio-2-col.html">Zaměstnanci</a>
</li>
<li>
<a href="portfolio-3-col.html">Historie</a>
</li>
<li>
<a href="portfolio-4-col.html">Kompletní informace</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Studium <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="portfolio-1-col.html">Informační technologie</a>
</li>
<li>
<a href="portfolio-2-col.html">Agropodnikání</a>
</li>
<li>
<a href="portfolio-3-col.html">Obchodní akademie</a>
</li>
<li>
<a href="portfolio-4-col.html">Maturity</a>
</li>
<li>
<a href="portfolio-item.html">Formuláře</a>
</li>
<li>
<a href="xxx.html">Třídy</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Jídelna <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="blog-home-1.html">Jídelníček</a>
</li>
<li>
<a href="blog-home-2.html">Přihlašování obědů</a>
</li>
</ul>
</li>
<li>
<a href="#">Domov mládeže </a>
</li>
<li>
<a href="#">Galerie </a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>

CSS

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,700);
html,
body {
height: 100%;
font-family: 'Open Sans', sans-serif;
}

.navbar-fixed-top {
background-color: #5b5147;
border-color: transparent;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
height: 100px;
text-transform: uppercase;
}


.navbar-inverse li {
padding-top: 20px;

}

.navbar-brand {
padding-top: 20px;
}

body {
padding-top: 100px; /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
}

.img-portfolio {
margin-bottom: 30px;
}

.img-hover:hover {
opacity: 0.8;
}

/* Home Page Carousel */

header.carousel {
height: 500px;
}

header.carousel .item,
header.carousel .item.active,
header.carousel .carousel-inner {
height: 100%;
}

header.carousel .fill {
width: 100%;
height: 100%;
background-position: center;
background-size: cover;
}

.center-block {
float:none;
display: inline-block;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
text-align: center;
}

#ikonky{
color: #5c6465;
}



/* Footer Styles */

footer {
margin: 50px 0;
}

/* Responsive Styles */

@media(max-width:767px) {
.img-portfolio {
margin-bottom: 15px;
}

header.carousel .carousel {
height: 70%;
}

}

最佳答案

如果你改变这个

.navbar-fixed-top {
height: 100px;
}

为此:

.navbar-fixed-top {
min-height: 100px;
}

当菜单打开时,背景颜色应显示在菜单上。

关于html - Bootstrap 中损坏的导航栏折叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35614359/

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