问题
My problem is that i want to write this in single selection :
.btn-primary > i.glyphicon {
color: #ffffff;
}
.btn-primary > span.glyphicon {
color: #ffffff;
}
But this :
.btn-primary > i.glyphicon, span.glyphicon {
color: #ffffff;
}
doesnt work. Because all the span.glyphicon tags are geting white color. How do solve this?
回答1:
Comma separate them:
.btn-primary > i.glyphicon,
.btn-primary > span.glyphicon {
color: #ffffff;
}
More info can be found at w3.org about grouping.
If you want to 'shortcut' them, you'll need a CSS pre-processor, like SCSS or SASS.
来源:https://stackoverflow.com/questions/29685752/how-to-write-multiple-css-selectors-in-one-line