Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q5408 What is the !important CSS rule?

irt.org | Knowledge Base | CSS | Q5408 [ previous next ]

Q5408 What is the !important CSS rule?

CSS tries to create a balance of power between author and user style sheets. By default, rules in an author's style sheet override those in a user's style sheet.

However, for balance, an "!important" declaration takes precedence over a normal declaration. Both author and user style sheets can contain "!important" rules, but user "!important" rules override author "!important" rules.

Note: In CSS1, it works the other way: Author "!important" rules took precedence over user "!important" rules.

If you, in your style sheet want to mark something as important, use the following code:

P { font-size: 18pt ! important }

You are telling your user, that it is important, that you use 18pt, as your fontsize.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.