Can a CSS class inherit one or more other classes?

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

    Less and Sass are CSS pre-processors which extend CSS language in valuable ways. Just one of many improvements they offer is just the option you're looking for. There are some very good answers with Less and I will add Sass solution.

    Sass has extend option which allows one class to be fully extended to another one. More about extend you can read in this article

提交回复
热议问题