Target elements with multiple classes, within one rule

后端 未结 2 782
孤独总比滥情好
孤独总比滥情好 2020-12-22 16:55

I have some HTML that would have elements with multiple classes, and I need to assign them within one rule, so that the same classes could be different within different cont

2条回答
  •  借酒劲吻你
    2020-12-22 17:30

    .border-blue.background { ... } is for one item with multiple classes.
    .border-blue, .background { ... } is for multiple items each with their own class.
    .border-blue .background { ... } is for one item where '.background' is the child of '.border-blue'.

    See Chris' answer for a more thorough explanation.

提交回复
热议问题