Talk:DOM:element.className
From MDC
Does it possible to has more than one class for one DOM element ?
It is possible to has multiple classes in CSS (which related to DOM, in which CSS descibed how to display a DOM).
-- Arthit 09:08, 17 Aug 2005 (PDT)
- 1) Yes. Use "class1 class2" (class names separated by spaces).
- 2) Not sure what you mean, but you can style different classes differently. So for example this will work:
<style type="text/css">
.tall {height: 100%}
.narrow {width: 10%}
</style>
<div class="tall narrow" style="background-color: grey;">
I'm tall but narrow!
</div>
--Nickolay 09:28, 17 Aug 2005 (PDT)