Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sass - two classes in a single tag [duplicate]

Tags:

css

sass

So, i need a style for

.question_actions.active 

my existing CSS

.question_actions {     float: right;     font-size: 1em;     width: 110px;  } .question_action {     margin-bottom: 8px;      padding: 3px; } .question_actions.active {     /* some CSS */ } 

what would be the syntax to combine them?

like image 436
meow Avatar asked Dec 02 '11 18:12

meow


People also ask

Can one tag have two classes?

HTML elements can be assigned multiple classes by listing the classes in the class attribute, with a blank space to separate them.

How do I use two classes in SCSS?

SASS/SCSS code to select multiple select classes in the same item. In SCSS, parent selector & symbol is used. This & will be resolved side by side after compilation for CSS.

How do you add two classes to a tag?

To specify multiple classes, separate the class names with a space, e.g. <span class="left important">. This allows you to combine several CSS classes for one HTML element.

How do I put two classes in a div?

To define multiple classes, separate the class names with a space, e.g. <div class="city main">. The element will be styled according to all the classes specified.


1 Answers

Here you go:

.question_actions {    float: right;     font-size: 1em;    width: 110px;      .question_action {        margin-bottom:8px;        padding: 3px;    }     &.active {     //some css    } } 
like image 158
Rito Avatar answered Sep 24 '22 07:09

Rito