-3

So If I'm working on designing a page for a website, can I give the class attribute multiple css classes? For example, is this correct and will it display all the css code located in these classes? Thanks!


<a class="account-group js-account-group js-action-profile js-user-profile-link"></a>
Statis
  • 1
  • 4
  • 1
    Why is someone so sad to downvote a question haha seriously, whats wrong with the question – Statis Jan 05 '15 at 05:55

4 Answers4

1

Yes, you can use multiple classes in html like you're having just by separating different classes with space.

Look at the spec for more info.

Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231
0

Simple and well know answer: Yes

Bharadwaj
  • 2,535
  • 1
  • 22
  • 35
0

Yes it's completely valid.

However the rules will override each other in corresponding order.

For example, if account-group and js-account-group both have a rule of, let's say, font-size, it'll take the value of js-account-group if that makes sense

I'm on my phone so it's hard to explain properly and add formatting

Mark Eriksson
  • 1,455
  • 10
  • 19
0

Yes, and what you wrote is right. But be careful the override issue css-multiple-classes-property-override

Community
  • 1
  • 1
Adison
  • 111
  • 8