How can I apply styles to multiple classes at once?
Solution 1:
.abc, .xyz { margin-left: 20px; }
is what you are looking for.
Solution 2:
You can have multiple CSS declarations for the same properties by separating them with commas:
.abc, .xyz {
margin-left: 20px;
}
Solution 3:
Don’t Repeat Your CSS
a.abc, a.xyz{
margin-left:20px;
}
OR
a{
margin-left:20px;
}
Solution 4:
If you use as following, your code can be more effective than you wrote. You should add another feature.
.abc, .xyz {
margin-left:20px;
width: 100px;
height: 100px;
}
OR
a.abc, a.xyz {
margin-left:20px;
width: 100px;
height: 100px;
}
OR
a {
margin-left:20px;
width: 100px;
height: 100px;
}