だから私はかなり一般的だと思う問題を抱えていますが、まだ良い解決策を見つけていません。ページ全体を覆うオーバーレイdivを作成したい...ビューポートだけでなく。なぜこれが難しいのかわかりません... body、htmlの高さなどを100%に設定してみましたが、うまくいきません。ここに私がこれまでに持っているものがあります:
<html>
<head>
<style type="text/css">
.OverLay { position: absolute; z-index: 3; opacity: 0.5; filter: alpha(opacity = 50); top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; background-color: Black; color: White;}
body { height: 100%; }
html { height: 100%; }
</style>
</head>
<body>
<div style="height: 100%; width: 100%; position: relative;">
<div style="height: 100px; width: 300px; background-color: Red;">
</div>
<div style="height: 230px; width: 9000px; background-color: Green;">
</div>
<div style="height: 900px; width: 200px; background-color: Blue;"></div>
<div class="OverLay">TestTest!</div>
</div>
</body>
</html>
また、JavaScriptのソリューションがあればそれを受け入れますが、単純なCSSを使用するだけです。