CSS Hacks and Filters - a full list?

  • goldschmidt
  • Born
  • Born
  • goldschmidt
  • Posts: 2

Post 3+ Months Ago


Is there any good reference out there that has a list of all the ways to hide CSS from certain browsers and the ways to show CSS only in certain browsers? I know a few of them (conditional statements for IE, the weird ::root thing with Safari, etc.). I just can't find a comprehensive recent list of things like: if you want to hide code from IE, do this; want to show code only to Firefox do this, etc. The last list I found was in a book from 2005, which doesn't include IE 7 or much of anything for Safari.

I understand that CSS hacks and filters are constantly changing and it's hard to find a good updated list, but the logo image on my website is off by one pixel on Safari browsers and Opera browsers, and is actually perfect on everything else. I'm hoping there's some workaround that's easier than redesigning my layout. Thanks!

-Andrew G
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

maybe just post the problem first ... I have never used hacks anywhere and all my sites work in all browsers so far ...
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2194
  • Loc: Canada

Post 3+ Months Ago

If you don't care about CSS validation you can use this line to only display in IE; it's good if you've got quite a few tables and need to tweak them 1 or 2 pixels for IE only.
There's other uses as well, such as aligning block elements, etc.

Code: [ Select ]
width: expression(document.body.clientWidth > 1 ? "10px": "auto");

Code: [ Select ]

Your css selector. padding-bottom, height, etc.

Code: [ Select ]
expression(document.body.clientWidth > 1 ?

Your if statement. If I have to use something this is what I use, as the clients browser will always be larger than 1 pixel.

Code: [ Select ]

Your value. In this case, width: 10px;

Code: [ Select ]
: "auto");

The ending. Tells the browser to apply it via CSS.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.