CSS trouble; using absolute positioning for a box doesn't seem to place it in the exact same spot in Firefox and Internet Explorer. [more inside]
Some days ago I redesigned my website (
link), going with a tableless/CSS-controlled approach.
Only one bug remains to be solved, and here's where your help is needed.
On the top-right of the content column, there is a rectangular gray box titled "Content". On the top-left of the menu column, lays a similar box titled "Menu".
I'm using the following CSS code for these:
--
#content-indication{
background: #EEEEEE;
border-left: 1px solid #C0C0C0;
border-bottom: 1px solid #C0C0C0;
left: 334px; /* IE wants 335px ?! */
position: absolute;
top: 73px;
width: 87px; /* for IE5/Win */
voice-family: "\"}\"";
voice-family: inherit;
width: 85px; /* actual value */
}
html>body #content-indication{
width: 85px; /* Be nice to Opera */
}
#content-indication h2{
color: #333333;
font: small-caps 10px "Lucida Grande", Verdana, sans-serif;
letter-spacing: 2px;
margin: 0px;
padding: 1px;
text-align: center;
}
#content{
float: left;
margin: 0px;
padding-left: 15px;
padding-right: 15px;
width: 420px; /* for IE5/Win */
voice-family: "\"}\"";
voice-family: inherit;
width: 390px; /* actual value */
}
html>body #content{
width: 390px; /* Be nice to Opera */
}
#menu-indication{
background: #EEEEEE;
border-right: 1px solid #C0C0C0;
border-bottom: 1px solid #C0C0C0;
left: 421px; /* IE wants 422 px ?! */
position: absolute;
top: 73px;
width: 72px; /* for IE5/Win */
voice-family: "\"}\"";
voice-family: inherit;
width: 70px; /* actual value */
}
html>body #menu-indication{
width: 70px; /* Be nice to Opera */
}
#menu-indication h2{
color: #333333;
font: small-caps 10px "Lucida Grande", Verdana, sans-serif;
letter-spacing: 2px;
margin: 0px;
padding: 1px;
text-align: center;
}
--
Ideally, these two boxes should be separated by the vertical red line.
That's the way they look in Firefox, making me a happy man (
link).
In Internet Explorer, the boxes are moved
1 pixel to the left from their expected position, thus overlapping the vertical red line, and effectively breaking the whole thing (
link).
Any ideas on how to solve the problem? (
CSS-discuss wasn't able to help.)
Thanks in advance for your help!
posted by rhapsodie at 3:12 PM on August 24, 2004