IE HACKS
In a nutshell we use them to ensure objects are the same size and positioned the same in IE as they are in other "CSS complient" browsers. There probably are other reasons, but this is by and far the biggest difference between IE and other browsers.
Having said that I see many members posting the CSS they're using in here when asking for help with IE hacks that look like this:
div.classname {width:700px; border:2px solid Black; background:White; padding:4px; z-index:2;} html*div.classname {width:700px;}
This^^ will do nothing for you.
Browsers like Fire Fox and Navigator
add borders and padding to the size of your objects; Internet Explorer
doesn't. So what I'm saying is the above code will give you a div that is 712px wide in FF and 700px wide in IE.
If you want a div that is 700px wide in FF
and IE you have to code it as such:
div.classname {width:688px; border:2px solid Black; background:White; padding:4px; z-index:2;} html*div.classname {width:700px;}
Since there is 2px worth of border + 4px worth of padding on
each side of the div you have to add them and multiply by 2. Subtract this number from the width you want the div to be and that is the number you plug in for FF. So:
2px + 4px = 6px
6px x 2 = 12px
700px - 12px = 688px
All these same principles apply to the height of an abject. So
if you define the height of an object there's even more math:
div.classname {width:188px; height:288px; border:2px solid Black; background:White; padding:4px; z-index:2;} html*div.classname {width:200px; height:300px;}
And if say your
padding-top: or
border-top: is different than the rest there's even
more math:
div.classname {width:188px; height:290px; border:2px solid Black; border-top:0; background:White; padding:4px; z-index:2;} html*div.classname {width:200px; height:300px;}
And if that isn't all anoying enough, consider positioning. For some goofy reason, even though your div is only 688px [according to FF], if you have 2px worth of border and 4px of padding you have to add this to your positioning.
In other words FF considers your div 688px when it comes to sizing, but considers it 700px wide (after adding padding and borders) when it comes to positioning. So, if you want your div centered in FF you need to code it like this:
div.classname {width:188px; height:288px; position:absolute; top:200px; left:50%; margin-left:-350px; border:2px solid Black; background:White; padding:4px; z-index:2;}
But there
is some good news. Because of this little fluke you
don't need to "hack" the positioning for IE:
div.classname {width:188px; height:288px; position:absolute; top:200px; left:50%; margin-left:-350px; border:2px solid Black; background:White; padding:4px; z-index:2;} html*div.classname {width:200px; height:300px;}
So, the above^^ div will be 200px wide, 300px tall, 200px from the top, and perfectly centered in both IE and FF (and probably any other goofy little browser you may be using).
The other big difference is colors, but that could take up an entire website to explain. (In fact there are several websites dedicated to
just that.) There are supposedly 256 websafe hexadecimal (ie: ffffff) colors that will work in any current version of any browser. The truth is there are probably only 214 after you consider
every browser and OS.
The solution: use colors identified by name only, or use RGB (red, green, blue).
Examples:
body {background:Green;}
or
body {background:rgb (12, 00, 23);}
K, that's enough for now.
So how many of you still love FF?
Btw, that's not actually the RGB for green there^^ :P