
March 9th, 2004, 04:45 PM
|
 |
Newton's Apple Wizard
|
|
Join Date: Nov 2003
Location: Los Angeles
|
|
|
IE 6 and CSS Div Layers
I have posted the code below. Basically, in IE6 if I have a div positioned relatively in relation to its surrounding table there are many blank spaces that apper at the top of my page that i assume are IE6's way of reserving room for that div element. Does anyone know how to get this to work in IE6?
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
margin:0;
padding:0;
text-align:center;
}
p, td {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
table.outer {
margin-left:auto;
margin-right:auto;
background-color:#e5e5e5;
height:400px;
vertical-align:top;
}
div.outerdiv {
background-color:#e5e5e5;
position:relative;
width:770px;
text-align:left;
}
.PStyle1 {
color:black;
position:relative;
text-align:left;
}
-->
</style>
</head>
<body>
<div class="outerdiv" style="margin-left:auto; margin-right:auto;">
<div class="PStyle1" style="left:200px; top:100px; height:0px;"><img src="" alt="" name="spaceHolder" width="50" height="50" id="spaceHolder" style="background-color: #666666" /></div><div class="PStyle1" style="left:300px; top:200px; height:0px;"><img src="" alt="" name="spaceHolder" width="50" height="50" id="spaceHolder" style="background-color: #666666" /></div>
<table width="770" border="0" cellspacing="0" cellpadding="0" class="outer">
<tr>
<td style="vertical-align:top;text-align:left;">
<table width="770" border="0" cellspacing="0" cellpadding="0" style="background-color:blue;">
<tr>
<td>this should be at the top of the page</td>
</tr>
</table>
<p style="background-color:white;">This should be a tiny bit below the blue bar</p></td>
</tr>
</table>
</div>
</body>
</html>
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.
|