gpt4 book ai didi

html - 内容上方的导航栏(就像在上面的图层中一样)

转载 作者:太空宇宙 更新时间:2023-11-03 23:17:36 25 4
gpt4 key购买 nike

我想把我的导航栏放在我的大标题下面,但它在它的前面,不仅仅是在它上面,而是有点在前面

showing the problem

在代码中,导航栏位于“Debugando”下方,但显示在其上方,我希望它保留在下方,但它不起作用,我找不到原因。我认为与位置或 float 有关。

代码(先是 Css,然后是 html):

body {
margin: 0 0 0 0;
padding: 0 0 0 0;
font-family: Josefin Sans, sans-serif;
}

.navbar {
background: #428F48;
height: 40px;
border-radius: 0px;

margin: 0 0 0 0;
padding: 0 0 0 0;
}

.nav {
margin-top: 5px;
margin-left: 50px;
}

.nav-pills>li {
font-size: 24px;
margin-left: 20px;
}

.jumbotron {
background: #27b032;
width: 100%;
margin: 0 0 0 0;
padding: 0 0 0 0;
position: absolute;
}

.title {
font-size: 80px;
margin-left: 10%;
padding: 40px 0 40px 0;

float: left;
}

.description {
font-size: 20px;
margin-left: 5%;
padding-left: 3%;
border-left: 1px solid black;
height: 60px;
margin-top: 65px;

float: left;
text-align: center;
}

.description span{
margin-top: 15px;
position: absolute;
}

.dot {
-webkit-animation-name: blink;
-webkit-animation-duration: 1s;
-webkit-animation-fill-mode: both;
-webkit-animation-iteration-count: infinite;


animation-name: blink;
animation-duration: 1s;
animation-fill-mode: both;
animation-iteration-count: infinite;
}

@-webkit-keyframes blink {

25% {opacity: 100;}
50% {opacity: 0;}
25% {opacity: 100;}

}

@keyframes blink {
25% {opacity: 100;}
50% {opacity: 0;}
25% {opacity: 100;}
}

html:
<html>

<head>

<title>Debugando</title>

<meta charset="UTF-8">


<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="style.css">


<link href='http://fonts.googleapis.com/css?family=Josefin+Sans:400,700&subset=latin-ext' rel='stylesheet' type='text/css'>

</head>

<body>

<!--- Top -->
<div class="content-fluid">

<div class="jumbotron">

<div class="title">

<span>Debugando</span><span class="dot">.</span>

</div>


<div class="description">

<span>

Descrição foda será inserida aqui.

</span>

</div>

</div>

<div class="navbar">

<ul class="nav-pills">

<li>Início</li>
<li>Contato</li>

</ul>

</div>

</div>

<!--<script src="js/jquery-2.1.3.min.js"></script>-->
<script src="js/bootstrap.min.js"></script>
</body>

</html>

如果需要,我可以使用 Bootstrap 。感谢您提供帮助!

最佳答案

首先,如果您使用的是 Bootstrap ,则需要将 .clearfix 添加到类为 .jumbotron 的 div。

<div class="jumbotron clearfix">

然后去掉.jumbotron的绝对定位

.jumbotron {
background: #27b032;
width: 100%;
margin: 0 0 0 0;
padding: 0 0 0 0;
}

希望这对您有所帮助。

关于html - 内容上方的导航栏(就像在上面的图层中一样),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29872351/

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