Internet Explorer 6 and below had a problem with the !important identifier that caused it to be ignored if another declaration of the same property appeared later in the same style declaration block. This can be used to feed Internet Explorer 6 and below special property values that are ignored by other browsers. Internet Explorer 7 fixed this issue.
Here is an example of this technique in use:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Test</title>
<style type="text/css">
p
{
background: green !important; /* Major browsers other than IE 6 and below respect the importance immediately */
background: red; /* IE 6 and below use this value instead, even though the above was marked as important */
}
</style>
</head>
<body class="page-body">
<p>Test</p>
</body>
</html>

No comments:
Post a Comment