Sunday, January 2, 2011

IE CSS Hacks

Internet Explorer.

It doesn't matter if it's IE 6, IE 7 or IE 8, they all suck.
Even though IE 8 has made some progress concerning CSS issue, IE 7 and obviously IE 6 are the worst browsers.

With CSS compatibility issues from here to Bill's office it takes too much work to make one CSS file fit all. That's why I thought of a small hack that I make in every HTML / XSLT / ASPX document I'm working with.

at the body tag of each page I insert a small html if:

<!--[if IE 6]>
<body class="ie6">

<!--[if IE 7]>
<body class="ie7">

<!--[if IE 8]>
<body class="ie8">

After placing that, you can easily create inside your general CSS file an inherited styling such as:
    { margin: 0 0 0 0; }
    { margin: 0 5px 0 0; }
    { margin: 0 0 5px 0; }
    { margin: 0 0 0 5px; }

This is the easiest way for me to work with IE 6 and IE 7 (and sometimes IE 8).  There is another way to make style compatible with IE browsers which involves creating different CSS file for every IE:

<link rel="stylesheet" type="text/css" href="general.css" />

<!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="generalIE6.css" />

<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="generalIE7.css" />

<!--[if IE 8]>
    <link rel="stylesheet" type="text/css" href="generalIE8.css" />

Good luck, and hopefully we won’t need any CSS hacks for Internet Explorer 9,
Elad Shalom,
CTO at


  1. Download All Recent Games , Movies And Apps For
    Free at

    You can download from the following categories

    Applications (RSS)
    Android (RSS)
    iOS (RSS)
    MAC (RSS)
    Windows (RSS)
    Ebooks (RSS)
    eBook (RSS)
    Magazines (RSS)
    Games (RSS)
    Linux (RSS)
    MAC (RSS)
    PC (RSS)
    PS3 (RSS)
    PSP (RSS)
    Wii (RSS)
    XBOX360 (RSS)
    Movies (RSS)
    BDRiP (RSS)
    Cam (RSS)
    DVDRiP (RSS)
    DVDRiP Old (RSS)
    HDRiP (RSS)
    R5 (RSS)
    RC (RSS)
    SCR (RSS)
    Staff Picks (RSS)
    Telecine (RSS)
    Telesync (RSS)
    Workprint (RSS)
    Music (RSS)
    Albums (RSS)
    iTunes (RSS)
    MViD (RSS)
    Singles/EPs (RSS)
    Staff Picks (RSS

    Download everything for free at http://estrip.

  2. Fabulous, what a website it is! This weblog provides valuable facts to us, keep
    it up.

    Look into my weblog :: minecraft download

  3. Hi! I could have sworn I've been to this website before but after browsing through a few of the posts I realized it's new to me.

    Anyways, I'm definitely delighted I discovered it and I'll be bookmarking it and checking back

    Here is my weblog - dragonvale hints and cheats **

  4. Having read this I thought it was rather informative.

    I appreciate you taking the time and effort to put this short article together.
    I once again find myself spending a lot of time both reading and posting comments.

    But so what, it was still worth it!

    My web blog :: play minecraft for free

  5. Its not my first time to go to see this web page, i am browsing this
    web site dailly and get good facts from here everyday.

    Look at my website castleville secrets

  6. I'm excited to uncover this great site. I want to to thank you for ones time for this particularly fantastic read!!
    I definitely savored every little bit of it and
    i also have you book marked to look at new things in your web site.

    Also visit my webpage comptoir quartz ou granit Quebec