http://jsfiddle.net/cxwQF/12/。
注: 赤と緑のボックスは交差する必要があります。緑色のボックスは画像または動画です。ホバーすると黄色になりました。しかし、赤いボックスが始まる底ではありません。赤いボックスはコントロールです (たとえば、次の画像)。
質問。親 div を画像の後ろに、子 div を一番上に配置するにはどうすればよいですか。
マークアップ:
<div id='image'></div>
<div id='parent'>
<div id='child'></div>
</div>
CSS:
#image {
position: relative;
width: 100%;
height: 500px;
background: green;
z-index: 2;
}
#image:hover {
background: yellow;
}
#parent {
position: fixed;
bottom: 0;
width: 100%;
z-index: 1;
}
/*#parent:hover {
background: blue;
} */
#child {
position: relative;
margin: 0 auto;
width: 100px;
height: 100px;
background: red;
z-index: 3;
}