CSS hacks more – html>body & /**/


html>body is child selector command which IE can’t understand

So, html>body refers to the child, body, contained within the parent, html.


for All browsers

#header {margin-bottom: 3em;}

for non-IE
html>body #header {margin-bottom: 1em;}

because the later CSS will take precedence to the previous one.

This together result in CSS in the first line is for IE, second line is for others.


IE5’s misinterpretation of the box model. When specifying the width of an element in CSS, padding and borders aren’t included in this value. IE5 however, incoporates these values into the width value causing element widths and heights to become smaller in this browser.

#header {padding: 2em; border: 0.5em; width: 15em; width/**/:/**/ 10em;}

The 15em value will then be overridden by the second width value of 10em by all browsers except IE5,

which for some reason can’t understand CSS commands with empty comment tags either side of the colons.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s