Quickly Target IE6 & IE7 in CSS

When you create to make a browser specific attribute in CSS, it’s usually because something special needs to be done in order to accommodate Internet Explorer. Instead of creating a browser-specific stylesheet, a quick way is to use the following shortcuts to target IE6 and/or IE7.



#myDiv {

     color: #222222; /* normal attribute */
     *color: #222222; /* this attribute applies to IE7 and below */
     _color: #222222; /* this attribute applies to IE6 and below */

}


Leave a Reply

Spam Protection by WP-SpamFree