基本的に私が達成しようとしているのは、div の真ん中にある穴です。背後には、最終的にスクローラーになる 100% 幅の div があり、上部には再び 100% 幅の div がありますが、下からコンテンツが透けて見えるように中央に穴があります。現時点では、透明なpng背景画像を使用してこれを達成しましたが、.test
背後のdivをクリック可能にする必要があるため、より良い解決策を見つけようとしています.
jsFiddle デモ: http://jsfiddle.net/neal_fletcher/vmTHL/1/
HTML:
<div class="test"></div>
<div class="background-image"></div>
CSS:
.test {
position: absolute;
width: 100%; height: 240px;
background-color: red;
top: 0; left: 0;
z-index: 1;
cursor: pointer;
}
.background-image {
position: absolute;
width: 100%; height: 240px;
top: 0; left: 0;
z-index: 2;
background-image:url('http://oi42.tinypic.com/2ziwodd.jpg');
background-repeat:no-repeat; background-position:center;"
}
視覚的にはこれが私が求めているものですが、.test
div もクリック可能にする必要があります。どんな提案も大歓迎です!