Can a CSS class inherit one or more other classes?

前端 未结 30 3633
挽巷
挽巷 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:31

    The SCSS way for the given example, would be something like:

    .something {
      display: inline
    }
    .else {
      background: red
    }
    
    .composite {
      @extend .something;
      @extend .else;
    }
    

    More info, check the sass basics

提交回复
热议问题