What is the order of precedence for CSS?

前端 未结 8 1799
攒了一身酷
攒了一身酷 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:22

    The order in which the classes appear in the html element does not matter, what counts is the order in which the blocks appear in the style sheet.

    In your case .smallbox-paysummary is defined after .smallbox hence the 10px precedence.

提交回复
热议问题