Posted By

michellebracken on 08/18/11


Tagged


Versions (?)

HTML Hack for IE


 / Published in: CSS
 

Another way to target IE specifically is to use the HTML * hack. Internet Explorer allows you to use something other than the html element as the root of your document. By placing an * in front of html in your CSS (*html) you can target IE only as other browsers will ignore the declaration.

IE will use 600px for the width of the content div, while other browsers use 580px. The above works for IE6 and below. When not in standards mode, but in quirks mode this will work on IE7 as well. You can also target IE7 (in quirks mode) specifically with

Report this snippet  

You need to login to post a comment.