Is there a shortcut for setting !important on every property in a CSS file?

后端 未结 4 475
情歌与酒
情歌与酒 2021-01-14 00:00

I have a large CSS file for which I would like to add !important to every CSS property. Is there one-line shortcut to make a whole .css file !important

4条回答
  •  借酒劲吻你
    2021-01-14 00:12

    No. Also, don't overuse !important: it should be a last resort. The effect of applying !important to all CSS declarations is equivalent to having no !important added to each declaration.

    Use more specific selectors (#id) instead of adding !important if you want a certain property to take precedence.

提交回复
热议问题