Forum Moderators: not2easy
#subnav{
position: relative;
margin: 10px 0 0 34px;
padding: 0;
background: #DDD;
border: 1px dashed;
width: 160px;
voice-family: "\"}\"";
voice-family:inherit;
width: 158px
}
Mozilla displays this properly with a total width of 160px(including borders). When viewed in IE6 it displays it with a width of 158px (including borders).
So IE6 seems to be displaying the whole width AND borders inside the 158px width. Mozilla seems to display correctly with a width of 158px and then adding the 2px for the left and right borders.
What are some possible ways to resolve this problem other than getting rid of my borders?
I'm having a problem with IE6 and Firefox.
#rightbar {
padding: 5px;
float:right;
text-align:center;
border-left: 1px solid #DADADA;
height: 100%;
width: 150px;
voice-family: "\"}\"";
voice-family:inherit;
width:139px;
}
html>body #rightbar {
width:139px;
}
The width of my rightbar is 139 + 10(padding) + 1(left border) = 150 total width. Displaying perfectly in Firefox/Mozilla. But only displaying 139px total width with padding, borders inside in IE6. I checked the Doctype, its correct.
If I add the line
* html #rightbar {
width:150px;
}
it works correctly both in IE6 and Firefox. But I afraid it'll break in IE5.x.
I dont know what to do...
my doctype is
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Is my IE6 still in quirks mode and rendering the box model like IE5.x?
Please anybody help......
To fix it just for IE6, simply make sure you have a valid DOCTYPE on the very first line of your page. This will cause IE6 to enter Standards mode and use the correct, compliant box model.
If you then want to fix it for IE5.x (which is incapable of using the right box model), do the star hack as suggested above...
* html YOURSELECTOR {
width: IE_WIDTHVALUE; /* add width + margins + padding + borders*/
w\idth: ORIGINAL_WIDTH_VALUE; /*the one Moz gets*/
}
The second width with the \ in it is a way to give IE6 back the correct, compliant width value (Ie5.x can't read past the escape character (\) and ignores it. Ie6 can.) It's necessary because, with the DOCTYPE fixed, IE6 is working compliantly.