What are the priorities among CSS selectors

前端 未结 9 1587
日久生厌
日久生厌 2020-11-27 22:27

CSS Question: If two different selectors apply to an element, who wins?

I know this shouldn\'t happen, but I want to tweak a legacy application, and the CSS is getti

9条回答
  •  佛祖请我去吃肉
    2020-11-27 22:53

    Order in the CSS file only matters if the selectors share the same specificity.

    For more on selector specificity: Andy Clarke penned Specificity Wars which is the best overview of how they work.

提交回复
热议问题