-7

I want to know if it is possible to add two classes in a single div.

<div id="one" class="two"></div>

This is the normal case,But for the purpose of adding an animation,i have to add an another class to the same div.If it is not possible,then is there any way to get the desired output,without using two classes ?

Gonsalo Sousa
  • 495
  • 4
  • 9
Ajith
  • 181
  • 1
  • 1
  • 10

4 Answers4

4

Yes it is possible, just separate each class with a space.

<div id="one" class="myclass1 myclass2 myclass3">
    content
</div>
Sergio Flores
  • 5,231
  • 5
  • 37
  • 60
0

You can add ass many classes as you want!

<div id="one" class="two tree four etc... "></div>
Gonsalo Sousa
  • 495
  • 4
  • 9
0

Just give a space between the classnames...

<div class="class1 class2"></div>
0

there can be many classes of a single div or any html element separated by spaces, But id shd only be one.

<div id="content" class="class1 class2 class3....">Content</div>
TECHNOMAN
  • 361
  • 1
  • 9