我有两个 div(顶部和底部),顶部 div 中的一个 div 应该与底部的一个重叠。尽管查看了此问题的常见答案,但我仍然无法使其正常工作。
#above {
position:relative;
height: 60px;
z-index: 1;
background: #000;
background: -moz-linear-gradient(top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.8) 90%, rgba(0,0,0,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.8)), color-stop(90%,rgba(0,0,0,0.8)), color-stop(100%,rgba(0,0,0,1)));
background: -webkit-linear-gradient(top, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.8) 90%,rgba(0,0,0,1) 100%);
background: -o-linear-gradient(top, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.8) 90%,rgba(0,0,0,1) 100%);
background: -ms-linear-gradient(top, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.8) 90%,rgba(0,0,0,1) 100%);
background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%,rgba(0,0,0,0.8) 90%,rgba(0,0,0,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cc000000', endColorstr='#000000',GradientType=0 );
}
#under {
position:relative;
background-color: blue;
height: 60px;
}
#tab {
background-color: yellow;
height: 120px; width: 50%;
}
<div id="above">
<div id="tab">Without filter</div>
</div>
<div id="under">Under</div>