Click to See Complete Forum and Search --> : Two Declarations


Dysan
01-02-2008, 08:51 PM
How do I add two CSS declarations to a div?

<div id="box"></div>

NogDog
01-02-2008, 09:04 PM
Not sure what you mean. If you are referring to the ID attribute, a HTML element may only have one ID assigned to it. However, it may also have one or more class attributes, e.g.:

<div id="box" class="class1 class2 class3"></div>

Stylesheet:

/* of these would apply to the above <div> */
#box { color: red; }
.class1 { border: solid 1px blue; }
.class2 { background-color: #ccffff; }
.class3 { margin: 1em 0; }