| Browser | Internet Explorer | Netscape | Opera | Safari | Firefox | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Version | 5.5 | 6.0 | 7.0 | 8.0 | 8.0 | 9.0 | 7.0 | 8.0 | 9.2 | 9.5 | 1.3 | 2.0 | 3.1 | 1.5 | 2.0 | 3.0 |
| Supported | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
Short information
| CSS | CSS2 |
|---|---|
| Default value | No |
| Inherited | No |
| Applied | To all elements |
| HTML analog | No |
| Reference to specification | http://www.w3.org/TR/CSS21/cascade.html#important-rules |
Description: The "!important" allows increasing a style parameter in case when styles of users and authors tables are not identical. A browser goes by next algorithm while a styles table is used. Also this algorithm is used when authors and users styles are not similar and applied concurrently. 1. If "!important" is added to an author style, this style will be used. 2. If "!important" is added to a users style, it will be applied. 3. If "!important" is unavailable in both styles, an author stile will be used. 4. If "!important" is available in both styles, in this case a user style will be used.
Result of "!important" using is indicated below.
Result of "!important" using is indicated below.
|
Author style
|
User style
|
Result
|
|
BODY { /* Grey color of the text */ color: silver; /* Text size is 8 */ font-size: 8pt }
|
BODY { /* Black colour of the text */ color: #000; /* Text size is 12 */ font-size: 12pt }
|
Lorem ipsum dolor sit amet... The author style will be used: the grey color of a text. The script size is 8.
|
|
BODY { /* Grey color of the text */ color: silver; /* Text size is 8 */ font-size: 8pt }
|
BODY { /* Black colour of the text, very important*/ color: #000 !important; /* Text size is 12 */ font-size: 12pt }
|
Lorem ipsum dolor sit amet... The text color will be installed by the user and the script size will remain initial one. Finally we can see a black text. Its size will be 8 points.
|
|
BODY { /* Grey color of the text */ color: silver; /* Text size is 8 */ font-size: 8pt }
|
BODY { /* Black colour of the text, very important */ color: #000 !important; /* Text size is 12, very important */ font-size: 12pt !important }
|
Lorem ipsum dolor sit amet... All user profiles will be used. Text will begin to be displayed as black with a size of 12 points.
|
|
BODY { /* Grey color of the text, very important */ color: silver !important; /* Text size is 8, very important */ font-size: 8pt !important }
|
BODY { /* Black colour of the text, very important */ color: #000 !important; /* Text size is 12, very important */ font-size: 12pt !important }
|
Lorem ipsum dolor sit amet... When you add "!important" to any table, in this case priority has the users style. Finally a text will be black and the size increases to 12 points.
|
Syntax
Properties: value of !importantArguments This attribute has no arguments
Example
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <title>important</title> <style type="text/css"> P { background: url('/images/mklvfkwr.gif') no-repeat !important; } </style> </head> <body> <p>Minor pentatonic with decreased V stage also is called the bluesy pentatonic.</p> </body> </html> |


