jeffrey

i like butter, don’t you?

via Twitter: @tom23flight stink. hope she feels better. give her some dried beef in reply to tom23flight 1 week ago

Browser CSS hacksApril 12th, 2007

Be warned, this post is for me, and for anyone who likes or dislikes workarounds for common CSS problems (i.e. you hate IE).

Display CSS in IE 7:

  1. *:first-child+html [class]
  2. {
  3. }

Display CSS in IE 7 and Firefox (not IE 6):

  1. html>body [class]
  2. {
  3. }

Display CSS in Firefox:

  1. html>/**/body [class]
  2. {
  3. }

I’m afraid I must declare myself a geek. I’m not that savvy, really.

Categories:code, css, illogic, jeffrey-ism

8 Comments so far ↓

  • Johnny-johnny

    The middle one actually works in IE6? I thought it couldn’t handle CSS2 selectors like ‘>’…

    Must go and test…

  • Jeff

    Yes! You are right… my apologies. I didn’t mean to cause confusion :) Must learn to proofread… I found a great reference for CSS hacks that validate but I lost the page. It wasn’t cached in my browser for some reason…

  • Shannon

    i feel like the dumb kid in the room.

  • Eoghan

    Hey Jeff – I like to ignore IE!!
    When I can’t I use conditional comments like so:

    < !–-[if lt IE 7]-->

    [class] {
    }

    < --[endif]-->

  • Jeff

    I’ll fix it Eoghan :) That’s nifty as well. I found a great site with more conditional comments but I lost it. I need to find it again.

  • Jeff

    Shannon, don’t worry, this is geek speak. Remember me, freshman year, building a website for your class? This stuff relates to that! I’m guessing you don’t remember much about HTML and CSS? :)

  • webweaver

    This is a great page for conditional comments – scroll down a bit. It gives you (amongst other things) every combination of IE browsers you could ever want to target with CCs. Very useful.

    Taming Your Multiple IE Standalones

    I never use anything *but* CCs for hacks now. They rock!

  • Jeff

    Excellent! Thanks… by the way, where was that package you can download and install the different IE browsers all at once? I can’t seem to find it :-o

Leave a Comment