How to reuse css class content in another class without copying?

前端 未结 8 1077
北恋
北恋 2021-02-18 14:07

Is it possible to use existing css class as content in another class ?

I mean something like:

Contained in some library:
.class1 { text-indent: 100 }

 I         


        
8条回答
  •  鱼传尺愫
    2021-02-18 14:25

    I am assuming you want whatever is in .class1 plus some extra properties in .class2

    One way is to simply apply both classes to the element you want..

    
    

    another is to name both classes when setting the properties

    .class1, .class2 {text-indent: 100}
    
    .class2{/*extra properties here*/}
    

提交回复
热议问题