How to reuse styles?

前端 未结 9 1446
孤城傲影
孤城傲影 2021-02-12 14:36

Back in the past I learned a lot about CSS but now I can\'t remember how to reuse styles.

Example:

I have some tabs with class tab and I can switch

9条回答
  •  孤独总比滥情好
    2021-02-12 15:10

    1. You can extract base class with identic styles and mark your elements with two classes: .tab .base
    2. You can use dynamic css language as sass or less which supports classes inhritance

提交回复
热议问题