Gunlaug Sørtun wrote:
> !important is our last option (short of using inline-styles with
> !important on top), and overusing it may lead to stylesheets full of
> !important just to make them work. Such stylesheets are not easy to
> maintain at a later date.

Approving Georg's objections, the desperate situation I can remember 
where I used !important was to (partly) fix a parsing bug in IE when 
pseudo-elements met pseudo-classes.

But this only led to other bugs (i.e. if a hover rule was added).

Does anyone have examples where !important is a good choice?

Ingo

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">
                
a:link, a:visited {
        color: blue;
        display: block;
        }

#myID a {
        color: fuchsia;
        }
        

#myID a:first-letter {

        font-size: 2em;
/* to indicate, the selector does work, but the specificity is broken */

        color: red;
/* !important, or we get a blue first letter in IE, neither fuchsia nor 
red */
        }


</style>
</head>

<body>  
        <p id="myID"><a href="#">lorem</a></p>
</body>
</html>

-- 
http://www.satzansatz.de/css.html
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to