开发者

How and where use of !important can create problem for site user?

开发者 https://www.devze.com 2022-12-14 13:57 出处:网络
is it not good to use !important in favor of accessibility? How and where use of !important can create probl开发者_JAVA百科em for site user?The !important CSS rule has no impact on the users\' perceiv

is it not good to use !important in favor of accessibility? How and where use of !important can create probl开发者_JAVA百科em for site user?


The !important CSS rule has no impact on the users' perceived accessibility.

The only argument against !important is code readability/maintainability, as such rules tend to make stylesheets more complicated. As you only have two degree of "importance" (with/without !important), you might get yourself into a world of pain if you use the rule too often.

That said, you should not avoid !important at all costs, but you should consider alternative solutions before adding the rule all around your stylesheet.


I usually use this keyword when i am changing the theme of a site made with a cms like joomla or wordpress to overwrite their styles.

It has nothing to do with accessibility.


It does not create accessibility issues, as !important declarations can be overwritten with another !important declaration in user's own stylesheet.

0

精彩评论

暂无评论...
验证码 换一张
取 消