You should not use css hacks

… because css hacks are bad, bad, bad. Will not be supported in the future and there are better ways to do the same thing if you work hard enough. But, I am lazy and want to use one css file to work on different browsers. So here they are, hacks to hide certain styles properties from specific browsers (IEs that is…). Ask your doctor if css hacks are right for you.

Commented Backslash hack (hides styles from IE/Mac):

/*start iemac hide \*/
YOUR SELECTOR {
PROPERTY: VALUE;
}
/*end iemac hide*/

Underscore hack (gives values to IE/Win only):

YOUR SELECTOR {
PROPERTY: VALUE;
_PROPERTY: VALUE;
}

Star HTML hack (gives values to IE/Win only):

* html YOUR SELECTOR {
PROPERTY: VALUE;
}

(See this discussion board to see why they work.)

Related posts:

  1. Adding CSS
  2. Box Model Hack?
  3. Darn Box Model Hack
  4. Little CSS Expeiment … Failed
  5. Can’t say enough about FireFox
This entry was posted in Web/Print Design and Dev. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Welcome to Daigo’s Daily Digital Diorama. I blog about... whatever that comes to my mind.
  • Change color

    Purple Red Green Blue No Style

  • Archives

  • Calendar

    February 2005
    M T W T F S S
    « Jan   Mar »
     123456
    78910111213
    14151617181920
    21222324252627
    28  
  • Categories