gpt4 book ai didi

html - 删除页面上的上边距

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

我似乎无法删除页面顶部的这一点空间,我已经尝试了很多方法并四处阅读。唯一似乎有效的是 *{margin:0},但我真的不想那样做。任何人都知道这里的问题是什么?

您可以在此处查看相关页面:http://www.ryanlaurence.com/new/

HTML

<!DOCTYPE html>

<html>

<head>
<link href="Style.css" rel="stylesheet">
</head>

<body>
<div id = "Banner">
<p>Banner</p>
</div>
<div id = "Nav">
<div id="stripe"></div>
<ul>
<li><a href = "#"> Link</a> - </li>
<li><a href = "#"> Link</a> - </li>
<li><a href = "#"> Link</a> - </li>
<li><a href = "#"> Link</a> </li>
</ul>
</div>
<div class="Content">
<div></div>
</div>
<div id="Footer">

</div>
</body>

</html>

CSS

body, html{
background-color: #404040;
margin: 0;
padding: 0;
}

#Banner{
background-color: #333333;
height:200px;
top:0px;
}
#stripe{
height: 10px;
top: -14px;
position:relative;
background-color: #262626
}

#Nav{
width:100%;
height: 60px;
background-color: #262626;
}
#Nav ul{
margin: 0;
color: gray;
position: relative;
text-align: center;
}
#Nav ul li{
display: inline;
}
#Nav ul a{
color: gray;
text-decoration: none;
padding-right: 10px;
padding-left: 10px;
font-size: 25px;
font-family: "Orator Std", verdana;
text-align: center;
}
#Nav ul li a:hover{
color: white;
}

.Content{
background-color: #333333;
/*height: 800px;*/
position: relative;
top: 5px;
}
.Content div{
height:800px;
}
#Footer{
background-color:#57B4CC;
height:150px;
}

最佳答案

添加CSS:

#Banner p {margin:0}

您的横幅 div 中的段落有一个您想要去除的默认边距。

关于html - 删除页面上的上边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21324122/

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