Can a CSS class inherit one or more other classes?

前端 未结 30 3219
挽巷
挽巷 2020-11-22 00:01

I feel dumb for having been a web programmer for so long and not knowing the answer to this question, I actually hope it\'s possible and I just didn\'t know about rather tha

30条回答
  •  醉酒成梦
    2020-11-22 00:42

    I think this one is a better solution:

    [class*=“button-“] {
      /* base button properties */
    }
    .button-primary { ... }
    .button-plain { ... }
    

提交回复
热议问题