Does the order of css stylesheet definitions matter?

前端 未结 7 865
情歌与酒
情歌与酒 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:11

    There is a defined cascade in which the styles are sorted and applied. When declarations have the same importance (weight), origin and specificity then the latter declaration wins. Most answers cover importance and specificity here but not origin.

    Here are some very good slides about CSS Cascades. (Overview all resources)

提交回复
热议问题