tags:

views:

48

answers:

2

Hi, I want 2 classes with different names to have same property in CSS. I donot want to repeat the code. e.g

<a class="abc"></a>
<a class="xyz"></a>

CSS

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

Since both classes are doing the same thing , I should be able to merge it to one. how to do that ?

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

is maybe what you are looking for

Juraj Blahunka
ya exactly, Thanks :)
sat
+1  A: 

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

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