John Hesch

Echoing my thoughts and interests

I'm not sure if anyone is still reading this blog but if so, what would you consider to be the best way to use IE hacks in your stylesheets? IE allows the use of conditional statements like

CSS:
  1.  
  2. <!--[if IE]>
  3.   <link rel="stylesheet" type="text/css" href="ie.css" />
  4. <![endif]-->
  5.  

This allows you to load an IE specific stylesheet. You can learn more here

Or incremental overrides, like so

CSS:
  1.  
  2. div {...} /*style for all*/
  3. * html div {...} /*style for IE*/
  4.  

Or using hacks like this or any other type

CSS:
  1.  
  2. div#container p {
  3. margin:5px;
  4. _margin:8px;  // this will only be recognized by IE
  5. }
  6.  

The most frustrating thing about coding websites using stylesheets is trying to get the same look in the different browsers.

  1. Ron Said,

    I still read it :), and I use all of these hacks, too!

  2. John Said,

    Awesome. So, you don’t have a preference with one over the other?

  3. MrCorey Said,

    Yeah, I still check in (you’re still in my blogroll, although Gila hasn’t been my theme for a bit). I’m still not good enough at coding the themes (which is why I rely on great works such as yours) to incorporate IE hacks on my own yet (that’s what Google’s for). My favorite IE hack is still GRUB…

Graytone | Design: Tenant Report