What is the order of precedence for CSS?

前端 未结 8 1642
攒了一身酷
攒了一身酷 2020-11-22 09:43

I\'m trying to figure out why one of my css classes seems to override the other (and not the other way around)

Here I have two css classes

.smallbo         


        
8条回答
  •  不思量自难忘°
    2020-11-22 10:17

    Here's a compilation of CSS styling order in a diagram, on which CSS rules has higher priority and take precedence over the rest:

    Disclaimer: My team and I worked this piece out together with a blog post (https://vecta.io/blog/definitive-guide-to-css-styling-order) which I think will come in handy to all front-end developers.

提交回复
热议问题