body {
height: 3000px;
}
.fixed {
position: fixed;
width: 100%;
height: 60px;
top: 0;
left: 0;
background: #f4f4f4;
}
.fixed h3 {
position: relative;
z-index: 300;
color: #fff;
}
.overlay {
background-color: #000;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: .5;
position: fixed;
z-index: 1;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
<div class="overlay"></div>
<div class="fixed">
<center>
<h3>
Only this thing should be brought on top of overlay..
</h3>
</center>
</div>
现在我如何将 h3 放置在覆盖层顶部的 .fixed div 内。请与 z-index 一起发布一些关于固定的阅读。
http://jsfiddle.net/CvMLw/4/ 检查上面的jsfiddle,那么我如何将h3放在覆盖层之上..