Can a CSS class inherit one or more other classes?

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

    Perfect timing: I went from this question to my email, to find an article about Less, a Ruby library that among other things does this:

    Since super looks just like footer, but with a different font, I'll use Less's class inclusion technique (they call it a mixin) to tell it to include these declarations too:

    #super {
      #footer;
      font-family: cursive;
    }
    

提交回复
热议问题