Does the order of css stylesheet definitions matter?

前端 未结 7 868
情歌与酒
情歌与酒 2021-02-07 04:02

I have several stylesheets. The first one is a stylesheet with some styles that I would like to use as defaults. Depending on several factors, the code being used to generate

相关标签:
7条回答
  • 2021-02-07 04:35

    If I use this, can I trust that the values in the default stylesheet will be overridden by the values from the other stylesheet? I am using class selectors and will override values when the names match.

    The answer is "yes", as you noted, when the selectors on the second sheet are identical to the first.

    The use of !important will be the exception, so avoid it, as you also noted.

    0 讨论(0)
提交回复
热议问题