ดังนั้นฉันจึงมีปัญหาที่ฉันคิดว่าค่อนข้างบ่อย แต่ฉันยังไม่พบวิธีแก้ปัญหาที่ดี ฉันต้องการสร้าง Div โอเวอร์เลย์ครอบคลุมหน้าทั้งหมด ... ไม่ใช่แค่วิวพอร์ต ฉันไม่เข้าใจว่าทำไมสิ่งนี้ถึงทำได้ยาก ... ฉันได้ลองตั้งค่าร่างกาย 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 ธรรมดา ๆ