"头"和"菜单"之间的空白区域



我有这个问题,现在我知道了 html 和 css 的基础知识,我接受了这个网页外观的挑战,但我做了一些事情,知道它在地址栏和菜单之间有一个空格,我已经尝试了很多东西,但我仍然没有遇到问题。

非常感谢任何帮助我的人

CSS Index
body{
overflow: hidden;
}
.main{
position: relative;
margin: 70px auto;
width: 90%;
max-width: 1080px;
height: auto;
z-index: 480;
}
.contenedor-destacados{
width: 100%;
text-align: center;
background-color: rgba(232, 236, 237, 0.29);
display: block;
position: relative;
top: 40px;
border-radius: 10px;
}
.title-destacados{
display: block;
text-align: center;
/*padding: 10px;*/
color: rgb(50, 50, 50);
letter-spacing: 1.3px;
font-family: 'Droid Serif', serif;
}

CSS 菜单

*{
padding: 0;
margin: 0;
border: 0;
box-sizing: border-box;
}
body{
font-family: 'Roboto';
/*background-image: url('../img/portada_index_large.jpg');*/
}
.material-icons .icon-menu{
color: black;
}
header{
width: 100%;
box-sizing: border-box;
display: block;
height: 15px;
position: absolute;
background-color: rgb(3, 3, 3);
z-index: 1000;
} 
/*.contenedor-noticia{
position: static;
margin-top: 0;
display: block;
width: 100%;
height: 50px;
-moz-background-size: 100% 100%; 
background-size: 100% 100%;
background: url(../img/portada_index1.png) no-repeat center bottom;
overflow: hidden;
text-align: right;
background-color: rgb(0, 0, 0)
}*/
.navegacion-drawer{
display: none;
}
.btn-menu{
display: none;
}
.cont-logo-head{
float: left;
vertical-align: middle;
}
.logo-head{
margin: 4px 10px;
float: left;
}
.title-menu-bar{
color: #d1d1d1;
float: left;
padding: 5px;
margin-top: 7px;
letter-spacing: 2px; 
}
.navegacion{
width: 685px;
top: 2px;
display: block;
position: relative;
float: right;
height: 56px;
padding: 0;
box-sizing: border-box;
z-index: 500;
margin-right: 3px;
}
.menu-general{
list-style: none;
position: absolute;
z-index: 640;
width: 100%;
display: block;
padding: 0;
box-sizing: border-box;
background: rgb(3, 3, 3);
}
.menu{
float: left;
vertical-align: middle;
position: relative;
display: block;
padding: 0;
}
.menu:before{
content: "";
display: block;
width: 0;
height: 3px;
background: #CBCBCB;
transition: all .5s;
left: 50%;
position: absolute;
}

在此处输入图像描述

我认为这是因为在你的.main你有

margin: 70px auto

我不知道您的页面,所以这可能不是它,但请尝试更改为margin: 0 auto

更新:相反,请从.contenedor-destacados中删除top:40px

您需要添加top:0;

header {
width: 100%;
box-sizing: border-box;
display: block;
height: 15px;
position: absolute;
background-color: rgb(3, 3, 3);
z-index: 1000;
top: 0;
}

最新更新