If !important is used on a declaration with a shorthand
property, it??™s equivalent to adding !important to all of the individual subproperties.
Placement of !important
Make sure the !important statement is placed at the end of the declaration, just
before the semicolon, and after the value. It will be invalid if it??™s located anywhere
else. Note also that when a shorthand property is used, the statement must still
appear at the end of the list of values for that property, not against each individual
value. Here??™s an example:
.example {
margin: 10px 12px 9px 8px !important;
}
The above rule would make all the margin values (top, right, bottom, and left
margins) for elements within a class of "example" !important.
Internet Explorer Support
In Internet Explorer 6 and earlier, if an important declaration appears before a normal
declaration for the same property within the same declaration block, the normal
declaration will overwrite the important declaration.
Internet Explorer 6 and 7 give importance to a declaration when an illegal identifier
is used in place of the keyword important, instead of ignoring the declaration as
they should.
Pages:
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193