As boogyman stated, most of the other popular browsers (Firefox, Opera, Safari, Konqueror) comply to the standards set forth by W3C.
So, the conditional statement is MOST USUALLY used specifically for IE due to the fact that as boogyman said, "IE is behind in that regards" (which by the way I believe to be the ultimate UNDERSTATEMENT of the year).
I believe that what boogyman was telling you is to code "to standard", then fix IE if needed (usually is needed).
To use a conditional statement, you would put it in the <head> of your page, like so:
Code:
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="main-styles.css">
<!--[if IE]>
<style type="text/css">
body{
background:#000;
}
</style>
<![endif]-->
</head>
<body>
blah blah blah
</body>
</html>
The idea behind a css conditional statement is to correct any errors which a particular browser may render in css. So, if you look at your page and everything looks great in FF, then you open it in IE and it's shifted to the left 10px... Then in your conditional statement you would need to adjust either the position, padding, or margin depending on which element is out of whack.
Let's say that your "sidebar" is shifted 10px to the left in IE, but displays fine in FF, Opera, Safari, etc... Here's how you would fix it.
Code:
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="main-styles.css">
<!--[if IE]>
<style type="text/css">
#sidebar {
margin: 0 -10px 0 0;
}
</style>
<![endif]-->
</head>
<body>
blah blah blah
</body>
</html>
The code above would shift the sidebar 10px to the right ONLY IN IE.
I hope this was simple enough to understand.
Bookmarks