Although all the modern browsers manage CSS3 pretty well these days, Internet Explorer (especially the earlier versions) is well known for doing things in non-standard ways. Here are a few tricks to help you deal with the incompatibility.
How to make Internet Explorer–specific code
It’s a little easier for you to see how conditional comments work by viewing a simple example and then seeing how to use the conditional comment trick to fix CSS incompatibility problems.
Here is a simple page with Firefox.
Here it is displayed in IE 7.
Take a look at the code for IEorNot.html and see how it works.
<!DOCTYPE html> <html lang = "en-US"> <head> <meta charset = "UTF-8"> <title>IEorNot.html</title> </head> <body> <p> I will now use a conditional comment to determine your browser. I’ll let you know if you're using IE. </p> <!--[if IE]> <h1>You're using IE</h1> <![endif]→ </body> </html>
The only part that’s new is the strange comments:
<!--[if IE]> <h1>You're using IE</h1> <![endif]→
Conditional comments are a special feature available only in Internet Explorer. They allow you to apply a test to your browser. You can place any HTML code you wish between