Forum Moderators: not2easy

Message Too Old, No Replies

CSS recognition problem in IE6

Division goes a couple of pixels down in IE6

         

0nly

9:34 pm on Jul 31, 2008 (gmt 0)

10+ Year Member



Ok, here is the code.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<style type="text/css">
#right01
{
background:#FF0000;
width:525px;
height:90px;
float:left;
}
#right02
{
background:#00FF00;
width:200px;
height:10px;
float:left;
}
#right03
{
background:#0000FF;
width:10px;
height:80px;
float:left;
}
</style>
</head>
<body>
<div id="right01"></div>
<div style="width:200px;float:left;">
<div id="right02"></div>
<div id="right03"></div>
</div>
</body>
</html>

It works ok in IE7, Firefox, Opera, Safari... But in IE6 the "right03" division goes down by maybe 3px. I have no clue why is it happening...?

birdbrain

8:04 am on Aug 2, 2008 (gmt 0)



Hi there 0nly,

and a warm welcome to these forums. ;)

IE 6 for some reason assumes that a div element contains text and will give the div element sufficient height to contain the default font size.
If you add...

font-size:8px;

...or a lesser value to the #right02 rules, it will effect a cure.

birdbrain

0nly

8:28 pm on Aug 2, 2008 (gmt 0)

10+ Year Member



Yes it worked, big thanks. :P

birdbrain

8:46 pm on Aug 2, 2008 (gmt 0)



No problem, you're very welcome. ;)