bach dang
bach dang

Reputation: 185

Grouping css classes into one

Is it possible to group a bunch of classes into one for example:

 <button id="buttonCalculate" class="ui-btn ui-mini my-btn">Calculate</button>

It would be nice to group "ui-btn ui-mini my-btn" into a single class

Thanks

Upvotes: 1

Views: 1247

Answers (3)

Aaron
Aaron

Reputation: 550

You can chain css if you want to apply properties to this element when all three classes are present.

.ui-btn.ui-mini.my-btn { }

Upvotes: 0

Abdullah Ahmed
Abdullah Ahmed

Reputation: 73

Yes you can using CSS Mixins

Try reading this http://wynnnetherland.com/journal/css-mixins-vs-multiple-classes

Upvotes: 1

Afzaal Ahmad Zeeshan
Afzaal Ahmad Zeeshan

Reputation: 15860

Yes, you can group multiple classes in a single statement!

Like the one you're having!

<button id="buttonCalculate" class="ui-btn ui-mini my-btn">Calculate</button>

This is OK! And all the classes would be applied to it.

Upvotes: 0

Related Questions