inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,780
January 2015
msg
|
Post by Lynx on Jul 19, 2017 12:56:57 GMT -8
Edit: remember also there is no space between the important declaration and the rest of the CSS, e.g.: color: #000!important; Sorry, Kami, but that's not entirely true - as I've used something like color: #000 !important; many times without issue. Whitespace is ignored, which is why something like: .classname { font-weight: normal !important; color: #ffff00; background-color: #0000ff !important; }
works is because of whitespace being ignored. If whitespace wasn't ignored, it would have to be: .classname{font-weight;normal!important;color:#ffff00;background-color:#0000ff!important;}
Whitespace is just a matter of preference for readability. But you are correct in that the syntax has to be correct.
|
|
Kami
Forum Cat
Posts: 40,031
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,031
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 19, 2017 13:05:27 GMT -8
Edit: remember also there is no space between the important declaration and the rest of the CSS, e.g.: color: #000!important; Sorry, Kami, but that's not entirely true - as I've used something like color: #000 !important; many times without issue. Whitespace is ignored, which is why something like: .classname { font-weight: normal !important; color: #ffff00; background-color: #0000ff !important; }
works is because of whitespace being ignored. If whitespace wasn't ignored, it would have to be: .classname{font-weight;normal!important;color:#ffff00;background-color:#0000ff!important;}
Whitespace is just a matter of preference for readability. But you are correct in that the syntax has to be correct. No need to be sorry! Thank you for the clarification / correction :D
|
|