gpt4 book ai didi

html - 导航栏扩展错误

转载 作者:行者123 更新时间:2023-11-28 03:01:20 26 4
gpt4 key购买 nike

当我的导航栏展开时,我遇到了这个奇怪的错误。它似乎覆盖了列出的元素之一,在本例中为主页元素。

如果我能设法让它扩展到导航栏下方,那就太好了,就像在名为 proper navbar 的示例中一样。

这是我的导航栏代码:

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<body data-spy="scroll" data-target=".navbar-collapse">

<div class="navbar navbar-inverse navbar-fixed-top ">
<div class = "container">
<div class="navbar-header">

<a class="navbar-brand" href="#">Møllaren Café</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>

</button>
</div>

<div class="collapse navbar-collapse">
<ul class = "nav navbar-nav">
<li class = "active"><a href="#">Home</a></li>
<li><a href="#">Meny</a></li>
<li><a href="#">Om oss</a></li>
<li><a href="#">Kontakt</a></li>
</ul>
</div>
</div>
</div>

<body data-spy="scroll" data-target=".navbar-collapse">

<div class="navbar navbar-inverse navbar-fixed-top ">
<div class = "container">
<div class="navbar-header">

<a class="navbar-brand" href="#">Møllaren Café</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>

</button>
</div>


<div class="collapse navbar-collapse">
<ul class = "nav navbar-nav">
<li class = "active"><a href="#">Home</a></li>
<li><a href="#">Meny</a></li>
<li><a href="#">Om oss</a></li>
<li><a href="#">Kontakt</a></li>
</ul>
</div>
</div>
</div>

这是我的 Logo 字体 css。也许这就是问题所在?

@font-face {
font-family: 'Diploma Regular';
font-style: normal;
font-weight: normal;
src: local('Diploma Regular'), url('Diploma.woff') format('woff');
}

.navbar-brand{
font-family: 'Diploma Regular';
font-style: normal;
font-weight: normal;
src: local('Diploma Regular'), url('Diploma.woff') format('woff');
}

Navbar bug

Proper navbar

最佳答案

找不到任何问题。检查下面的代码片段,它工作得很好。

.navbar .navbar-nav li a:hover {
color: #be1d2c;
trans ition: color .3s;
}

.navbar-header {
height: 65px;
padding-top: 0;
}

.navbar-brand {
font-size: 2.5em;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<body data-spy="scroll" data-target=".navbar-collapse">

<div class="navbar navbar-inverse navbar-fixed-top ">
<div class="container">
<div class="navbar-header">

<a class="navbar-brand" href="#">Møllaren Café</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>

</button>
</div>


<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Meny</a></li>
<li><a href="#">Om oss</a></li>
<li><a href="#">Kontakt</a></li>
</ul>
</div>
</div>
</div>

关于html - 导航栏扩展错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46181964/

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