CSS hacks more – !important & /**/ and *html, *+html

Why would there be more hacks after those two posts before?

Because the more you know the better.

Mostly because after IE7, more problem IE causes…

Straight to example.

width: 100px!important; /* for IE7+FF */
width: 80px; /*for IE6 */

This one is most important, different style for FF, IE6 and IE7!!

2, IE6/IE77FireFox
#wrapper { width: 120px; } /* FireFox */
*html #wrapper { width: 80px;} /* ie6 fixed */
*+html #wrapper { width: 60px;} /* ie7 fixed


1. these hack maybe out of date after sometime.

2. mind the ordering of those style!

3. make sure the .html have the following header if you are using *+html hack.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” http://www.w3.org/TR/html4/loose.dtd”&gt;


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