How can I apply styles to multiple classes at once?

前端 未结 5 1243
刺人心
刺人心 2020-11-29 21:10

I want two classes with different names to have the same property in CSS. I don\'t want to repeat the code.

5条回答
  •  盖世英雄少女心
    2020-11-29 21:39

    You can have multiple CSS declarations for the same properties by separating them with commas:

    .abc, .xyz {
       margin-left: 20px;
    }
    

提交回复
热议问题