Quick Tip: How to Target IE6 and IE7 with Only Two Characters
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 */
}
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for the best web development tutorials on the web.
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
- http://www.spreadgun.com tom
- http://sffarlenn.net Laneth Sffarlenn
- oconn96
- http://www.soulsizzle.com Ryan Marganti
- oconn96
- Anna
- http://www.amberweinberg.com Amber Weinberg
- http://www.soulsizzle.com Ryan Marganti
- http://www.amberweinberg.com Amber Weinberg
- Mark
- Mark
- http://craigps.info/ Craigsnedeker
- http://www.soulsizzle.com Ryan Marganti
- Russell Skaggs
- http://twitter.com/lostkore lostkore
- http://www.wdonline.com Jeremy McPeak
- http://www.joshsalverda.com Josh Salverda
- Mike
- http://www.vileworks.com Stefan Matei
- http://www.redkingdesigns.com Rory
- http://www.vagrantradio.com Jason
- oconn96
- http://patareco.carbonmade.com/ Patareco
- http://themeforest.net?ref=derektoigo Derek
- http://ethan.luffle.com/ Ethan
- http://www.wdonline.com Jeremy McPeak
- http://sidouglas.net Simon
- mike Webs
- http://kirie.no/ Eirik Backer
- ed
- Kevin Groenendaal
- http://bloggerzbible.blogspot.com/ Bloggerzbible
- http://bonfx.com Douglas Bonneville
- http://bonfx.com Douglas Bonneville
- Rob
- http://www.subash.net.np Adikari
- http://www.www.webm.ag McBonio
- Ant
- Renee
- http://www.artviper.net Frank
- http://student.elon.edu/khogg Kimberly
- Britney
- David Meister
- mnt
- crash
- http://www.swopper-shop.de/ Swopper
- odinel
- http://twitter.com/kavitabarke kavita barke
- SEMEN
