
Originally Posted by
obfiscation
What if your center div is 50%of window vertical height and 75% of window width? To further obfuscate solution using CSS, what if your div has a border 2.5% of div width?
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Centered div</title>
</head>
<body>
<div style="position: absolute; left:12.5%; right: 12.5%; top: 25%; height: 6.33%; background:red;"></div>
<div style="position: absolute; left:12.5%; top: 25%; width: 3.33%; bottom: 25%;background:red;"></div>
<div style="position: absolute; left:12.5%; right: 12.5%; bottom: 25%; height: 6.33%; background:red;"></div>
<div style="position: absolute; right:12.5%; top: 25%; width: 3.33%; bottom: 25%;background:red;"></div>
<div style="position: absolute; left:12.5%; right: 12.5%; top: 25%; bottom: 25%; "></div>
</body>
</html>
Arie Molendijk
Bookmarks