Posted by Toby Inkster on 11/30/06 11:37
Agix wrote:
> can an element in code have a class(es) and an ID?
An element can have zero or one IDs, and zero or more classes. So you
could for example have:
<DIV id="quux" class="foo bar baz">
Example
</DIV>
And you could make that text stand out using the following CSS:
#quux { font-weight: bold; }
..foo { color: red; }
DIV.bar { background: yellow; }
..baz#quux { font-size: 150%; }
..foo.baz.bar { text-decoration: underline; }
That last line of CSS, selecting by multiple classes, wouldn't be
supported by IE 6 and below though. (IIRC.)
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
[Back to original message]
|