CSS hack for IE 6?

Discussion in 'HTML' started by delerious@no.spam.com, Dec 23, 2003.

  1. Guest

    I've read about the child selector hack (using something like html>body as a
    selector in the stylesheet), which is good when you want to use styles for all
    non-IE browsers.

    Is there a hack just for IE 6? I want to apply a style to IE 6 browsers but
    not IE 5.x browsers. It would be OK if the hack worked for non-IE browsers
    too, just as long as it excluded IE 5.x browsers.
     
    , Dec 23, 2003
    #1
    1. Advertising

  2. Steve Pugh Guest

    wrote:

    >I've read about the child selector hack (using something like html>body as a
    >selector in the stylesheet), which is good when you want to use styles for all
    >non-IE browsers.
    >
    >Is there a hack just for IE 6? I want to apply a style to IE 6 browsers but
    >not IE 5.x browsers. It would be OK if the hack worked for non-IE browsers
    >too, just as long as it excluded IE 5.x browsers.


    Have a look at http://centricle.com/ref/css/filters/ and the various
    linked pages. Several ways to hide styles from IE5 but not reveal them
    to IE6.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Dec 23, 2003
    #2
    1. Advertising

  3. delerious wrote:

    > Is there a hack just for IE 6?


    There are various hacks for different combinations of browsers. By
    combining several, it is usually possible to get a combination that works
    in any browser you like.

    Here is a hack to make some element (#mydiv) blue in IE 6, but red in
    other browsers.

    #mydiv { color: red; }
    #mydiv {
    \color: red;
    c\olor: blue;
    }
    html>body #mydiv { color: red; }

    Untested, but should work.

    IE 6 sees the first three 'color' properties, but not the last. IE 5 only
    sees the first two. Opera 6+ and Gecko see them all. As a result, IE 6
    applies the blue colour and others use red.

    Not sure what will happen in KHTML, but I think it should see what Opera
    and Gecko see.

    For more nice CSS hackism, see:

    http://www.goddamn.co.uk/tobyink/styles/two-column-layout.css

    That file does my two column layout for Opera 3.6+, Internet Explorer 4+,
    Gecko and Konqueror 3. I think it's pretty nifty.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Dec 23, 2003
    #3
  4. Guest

    Thanks for the replies, guys.
     
    , Dec 23, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ing. Rajesh Kumar
    Replies:
    2
    Views:
    9,529
    Kevin Spencer
    Jul 7, 2004
  2. altamir

    Nice CSS rollovers: IE hack

    altamir, Nov 17, 2003, in forum: HTML
    Replies:
    1
    Views:
    507
    e n | c k m a
    Nov 17, 2003
  3. windandwaves
    Replies:
    7
    Views:
    9,396
    windandwaves
    Oct 25, 2005
  4. nicolacantalupo

    css hack for ie

    nicolacantalupo, Jan 21, 2008, in forum: HTML
    Replies:
    0
    Views:
    382
    nicolacantalupo
    Jan 21, 2008
  5. Kabuki Armadillo

    Best css hack / trick to recommend?

    Kabuki Armadillo, Jun 23, 2008, in forum: HTML
    Replies:
    76
    Views:
    1,983
    Harlan Messinger
    Jun 27, 2008
Loading...

Share This Page