Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write multiple css selectors in one line?

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?

like image 427
Timsen Avatar asked Sep 12 '25 10:09

Timsen


1 Answers

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.

like image 57
LinkinTED Avatar answered Sep 15 '25 02:09

LinkinTED