On Sat, 05 Nov 2005 02:26:53 +0100, Koen wrote:
Hi group,
In a stylesheet I saw the next:
#menu ul {
width: 154px;
\width: 156px;
w\idth: 154px;
}
What is the difference between them and why is "\width" 2px more? Has it
something to do with browser differences?
Tnx!
Koen
Lo Koen,
This is indeed a hack to make sure different browsers (with all
their different CSS-interpretations) end up looking the same.
Perhaps off-topic but this kind of hack is not the prettiest if you ask
me. Look for information about the "Box Model Hack" to read up on the many
different solutions out there.
FWIW my personal favorite is the voice-family variant (see example)
because of it's cleanless.
/* Box Model Hack for IE5.x browsers */
#topicnav ul li a {^
margin-right: 10px; /* only IE5.x browsers will use this */
voice-family: "\"}\"";
voice-family: inherit;
margin-right: -5px; /* other browsers will use this */
}
HTH,
SomeDude