Does the order of css stylesheet definitions matter?

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

    The simple answer is yes. Any styles re-declared further down the pages will overwrite the classes declared earlier on in the page load.

    For this to work the second declaration of the class must be in the inheritance.

    Classes like .content{} and .body .content{} may behave differently when inheriting styles.

提交回复
热议问题