Quick Tip: How to Target IE6 and IE7 with Only Two Characters

Student iconAre you a student? Get a yearly Tuts+ subscription for $45 →

Did you know that, with the addition of only two characters, you can target both Internet Explorer 6 and 7 in your stylesheets? It's easy...I'll show you!

At a Glance

#someElement {
   background: red; /* modern browsers */
   *background: green; /* IE 7 and below */
   _background: yellow; /* IE6 exclusively */