Hi
I have encountered a 5px gap when running the code below in IE6 and IE7, and I need some advise here. You can see this by clicking the yellow DIV (e.g “dright”) which will show a vertical gap appearing between:
<div id=“dclear”> and <div id=“dbottom”>
The problem does not appear in IE8. You can see it also in “IE8 Dev Tools” while in IE7 View/Std.
Attached html text file.
Thanks!
-Itai
<!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 id=“Head1”><title>
</title>
<style type=“text/css”>
</style>
<script type="text/javascript" language="javascript">
function ddl_showhide(id) {
var e = document.getElementById('dbottom');
e.style.visibility = (e.style.visibility == 'hidden') ? 'visible' : 'hidden';
}
</script>
<style type="text/css">
#dleft
{
height:29px;
width:200px;
float:left;
margin: 50px 0px 0px 0px;
padding:0px;
border:0px;
background-color: #CCFFFF;
font-size:small;
}
#dright
{
height:29px;
width:17px;
display:block;
float:left;
margin: 50px 0px 0px 0px;
padding:0px;
border:0px;
background-color:Yellow;
}
#dclear
{
margin:0px;
padding:0px;
border:0px;
height:1%;
clear:both;
line-height:0px;
margin-bottom:0px;
}
#dbottom
{
width:215;
height:100px;
margin:0px;
padding:0;
border: solid 1px grey;
visibility:hidden;
background-color:blue
}
</style>
</head>
<body style=“margin:0; padding:0; border:0; position:relative;”>
<form name=“form1” method=“post” action=“list.html” id=“form1”>
<div>
</div>
<div style="margin: 0px auto; height: 500px; width: 500px;">
<div id="wrapper" style="width:217px; margin:0; padding:0px; border:0;">
<!-- left -->
<div id="dleft">Load in IE8 and click on the yellow area under IE7 mode</div>
<!-- right -->
<div id="dright" onclick='javascript:ddl_showhide(this)'></div>
<!-- Clear -->
<div id="dclear"></div>
<!-- Bottom -->
<div id="dbottom"></div>
</div>
</div>
</form>
</body>
</html>