1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
---|
2 | <html>
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
|
---|
5 | <style>
|
---|
6 | ul { line-height:160% }
|
---|
7 | a {
|
---|
8 | border-bottom:dashed 1pt red !important;
|
---|
9 | text-decoration:none !important;
|
---|
10 | }
|
---|
11 | .monospace { font-family:monospace !important; }
|
---|
12 |
|
---|
13 | </style>
|
---|
14 | </head>
|
---|
15 | <body>
|
---|
16 |
|
---|
17 | <h1>Handling of "!important" property flag</h1>
|
---|
18 | <p>
|
---|
19 | Normally later css style properties defined later are overriding earlier ones.<br>
|
---|
20 | Except if they are marked with the flag "!important".<br>
|
---|
21 | Those can only be overridden by style properties which are also marked "!important".
|
---|
22 | </p>
|
---|
23 |
|
---|
24 | <p>There are two classes of property overriding</p>
|
---|
25 | <ul>
|
---|
26 | <li>inherit (nested html tags)</li>
|
---|
27 | <li>merging (more css properties to the same html tag)</li>
|
---|
28 | </ul>
|
---|
29 | <p>This is handled similarly for all styles, so we check only examples here</p>
|
---|
30 |
|
---|
31 | <p>ul { line-height:160% }<p>
|
---|
32 |
|
---|
33 | <h2>merge a { border-bottom:dashed 1pt red !important; text-decoration:none !important; }</h2>
|
---|
34 |
|
---|
35 | <p>dummy links, text decoration/border bottom:</p>
|
---|
36 |
|
---|
37 | <ul>
|
---|
38 | <li><a href="">(default)</a></li>
|
---|
39 | <li><a href="" style="border-bottom-style:none;">border-bottom-style:none; (ignore)</a></li>
|
---|
40 | <li><a href="" style="border:1pt solid blue;">border:1pt solid blue; (ignore)</a></li>
|
---|
41 | <li><a href="" style="border-bottom-style:none!important;">border-bottom-style:none!important; (override)</a></li>
|
---|
42 | <li><a href="" style="border:1pt solid blue!important;">border:1pt solid blue!important; (override)</a></li>
|
---|
43 | </ul>
|
---|
44 |
|
---|
45 | <h2>Inherit .monospace { font-family:monospace !important; }</h2>
|
---|
46 | <p>font family selection:</p>
|
---|
47 | <ul class="monospace">
|
---|
48 | <li>(default)</li>
|
---|
49 | <li class="font-family:sans-serif;">font-family:sans-serif; (ignored)</li>
|
---|
50 | <li style="font-family:sans-serif!important;">font-family:sans-serif!important; (override)</li>
|
---|
51 | </ul>
|
---|
52 |
|
---|
53 | </body>
|
---|
54 | </html>
|
---|