Html 我的潜水艇违反我的意愿互相掩护
我的div互相覆盖,这不是我想要的。我已经通过调试器运行了它,但什么都没有出现。。。 我正在尝试建立一个弹出菜单 这是我的html:Html 我的潜水艇违反我的意愿互相掩护,html,css,Html,Css,我的div互相覆盖,这不是我想要的。我已经通过调试器运行了它,但什么都没有出现。。。 我正在尝试建立一个弹出菜单 这是我的html: <!doctype html> <html> <head> <link rel="stylesheet" href="noteBack.css"> </head> <body> <div class="container"> <h
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="noteBack.css">
</head>
<body>
<div class="container">
<header><span>Note</span></header>
<div class="sub-header"><span>friday 25.7.13 </span></div>
</div>
</body>
</html>
任何帮助都将不胜感激
您的定位系统出现问题,请尝试此css
.container{
/*container position should be absolute*/
position:absolute;
width:382px;
border:1px solid black;
}
header{
/*header position should be relative*/
position:relative;
width:100%;
height:41px;
color:white;
background-color:#de4b4b;
font-weight: bold;
font-size:14px;
margin:auto;
}
header span{
display:inline-block;
padding-left:172px;
padding-top:14px;
padding-bottom:14px;
}
.sub-header{
/*sub-header position should be relative*/
position:relative;
width:100%;
height:37px;
background-color:white;
font-size:10px;
margin:auto;
}
.sub-header span{
display:inline-block;
padding:bottom:14px;
}
绝对位置是你的问题。向我们展示一个jsfiddle并让我们知道哪些div没有表现出来可能会很好
.container{
/*container position should be absolute*/
position:absolute;
width:382px;
border:1px solid black;
}
header{
/*header position should be relative*/
position:relative;
width:100%;
height:41px;
color:white;
background-color:#de4b4b;
font-weight: bold;
font-size:14px;
margin:auto;
}
header span{
display:inline-block;
padding-left:172px;
padding-top:14px;
padding-bottom:14px;
}
.sub-header{
/*sub-header position should be relative*/
position:relative;
width:100%;
height:37px;
background-color:white;
font-size:10px;
margin:auto;
}
.sub-header span{
display:inline-block;
padding:bottom:14px;
}