I remember from watching a video on the YUI Theater by Nate Koechley on the YUI CSS Foundain library and heard a sweet little trick to write CSS comments for IE only without using conditional comments.

His trick was to just append an asterisk (*) to the beginning of any command that you want to be IE only.

  1. #Box {
  2.  
  3. min-height: 500px;
  4.  
  5. max-height: 1000px;
  6.  
  7. height: 600px;
  8.  
  9. *height: 500px;
  10.  
  11. }

Just remember to do your IE only command after the firefox command.  If you switched the two heights, IE would still read both and set its height to 600px.

1 comment

One Response to “Quick and easy IE only CSS”

  1. Black Belt Coder » IE6 only CSS syntax hack Says:

    […] talked about how you can use the asterisk to indicate a rule is for IE only but while doing some investigation for another issue I discovered another easy hack that could […]

Leave a Reply