Reputation: 37464
Please say there's a simpler/shorter way to write this CSS:
.ads h3{
color: #f7f7f7;
}
.ads p{
color: #f7f7f7;
}
.ads blockquote{
color: #f7f7f7;
}
It's a right pain at the moment and takes up space in the CSS file...
Upvotes: 3
Views: 200
Reputation: 14279
Unless there are any other overriding rules you haven't shown, this will be fine:
.ads
{
color: #f7f7f7;
}
Upvotes: 1
Reputation: 28701
You don't need the trailing ;
either (per YUI CSS Min)
.ads h3,.ads p,.ads blockquote{color:#f7f7f7}
Upvotes: 0
Reputation: 3858
You can write it like this to make it simpler/shorter.
.ads h3, p, blockquotes{
color: #f7f7f7;
}
Upvotes: 1
Reputation: 10429
"Your prayers have been answered my child"
.ads h3, .ads p, .ads blockquote {
color: #F7F7F7;
}
And even taking it further (if there are no child elements which should not be colored as well):
.ads * {
color: #F7F7F7;
}
And if you're OK with the text inside the paragraph itself to also have this same gray color:
.ads {
color: #f7f7f7;
}
This will be overridden by any other styles that have been set on p, blockquote or h3, so you might want to take it further:
.ads, .ads * {
color: #f7f7f7;
}
Upvotes: 6
Reputation: 112825
You can group selectors that you wish to share common rules by separating them with commas. So, the following will work:
.ads h3, .ads p, .ads blockquote {
color: #f7f7f7;
}
See the CSS 2.1 Specification, Section 5.2.1.
Upvotes: 7