【发布时间】:2014-07-19 21:44:06
【问题描述】:
尝试使此处显示的布局http://www.reversl.net/zindex/ 看起来像附加的图像 澄清......徽标(这是标题的一部分)需要覆盖图像。图像需要与标题的底部完美对齐。我知道这可以使用 z-index 来实现,但我该怎么做呢?
header {
width: 100%;
height: 30px;
background: #222;
position: relative;
z-index: 3000;
}
#login {
width: 30%;
float: right;
text-align: right;
padding: .5em 0;
z-index: 5000;
}
#logo {
width: 25%;
float: left;
padding: 3em 3em 1em 3em;
text-align: center;
z-index: 9999;
background: #222;
}
.logo-text {
font: 2em/1em "lucida grande";
display: inline-block;
color: #777;
}
#bg {
margin: -2em 0 0 0;
clear: both;
}
【问题讨论】:
-
猜测:添加到img样式:margin-top:-logo_height px;z-index:6000;
标签: css layout z-index css-position