HTML/CSS Service

CSS ! important Declaration

Category: CSS Tutorials, CSS3 Tutorial    |    1,170 views   |   

!important Declaration

Increases the weight or importance of a particular declaration.

Syntax

HTML
{ sRule!important  }

Scripting
N/A


Possible Values

sRule    Any CSS attribute/value pair.

Example

The following example includes an !important declaration in the style rule. Normally the color of the text would be red, because inline styles override the rules set in a style tag. By including the !important declaration in the style rule, you set the content of the paragraph to green.

<STYLE>
P { color:green!important }
</STYLE>
<P STYLE=”color:red”>This text will be green.</P>

This feature requires Microsoft Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • digg
  • del.icio.us
  • Stumble it
  • Furl
  • Reddit
  • BlinkList
  • Simpy
  • YahooMyWeb
  • Spurl

Share/Save/Bookmark

1 Star2 Stars

Tags: , ,

1 response so far!

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word