Reputation: 86337
I've got several CSS elements that I'd like to group.
At the moment I'm using:
.elementA {
padding: 3px;
}
.elementB {
padding: 3px;
}
I'd like to combine them into one rule to avoid repeating stuff over and over again. E.g.
.elementA and .elementB {
padding: 3px;
}
How do you do this?
Upvotes: 2
Views: 78
Reputation: 57332
.elementA, .elementB {
padding: 3px;
}
by comma separator ,
you can combine
Upvotes: 4
Reputation: 9413
Try this
.elementA,.elementB {
padding: 3px;
}
Reference http://www.smileycat.com/miaow/archives/000152.php
Upvotes: 2
Reputation: 420
Just separate your classes with a comma
.elementA, .elementB {
padding: 3px;
}
Upvotes: 1
Reputation: 32202
uSed to this
.elementA, .elementB{
padding: 3px;
}
Used the (,)
Comma
Upvotes: 1