Anthony Papillion II wrote:
> As I interpret it, a class can only be used within the HTML element it is
> linked to (i.e.<p class="yadda">)
No, this is not correct. A class can be used on any element. Example:
.yadda { color: red; }
<p class="yadda">This text is red.</p>
<li class="yadda">This text is red.</li>
<div class="yadda">This text is red.</div>
The exception to this is when you specify in your style sheet what
element a class can be used on. Example:
p.yadda { color: red; }
<p class="yadda">This text is red.</p>
<li class="yadda">This text is not red because the class doesn't apply.</li>
<div class="yadda">This text is not red because the class doesn't
apply.</div>
> while ID can be defined and used with
> *any* HTML element (i.e I could use <p id="header"> then also use <tr
> id="header">).
Which elements an id may apply to again depends on the selectors in your
style sheet. #header can apply to any element, but tr#header can only
apply to a tr element.
I suggest you read this:
http://css.maxdesign.com.au/selectutorial/
And bookmark this:
http://gallery.theopalgroup.com/selectoracle/
> Am I interpreting this correctly or am I missing something
> important?
>
Yes: The important distinction between classes and IDs is that an ID can
be used once per page and a class can be used limitlessly per page. And
IDs are more specific than classes.
Zoe
--
Zoe M. Gillenwater
Design Services Manager
UNC Highway Safety Research Center
http://www.hsrc.unc.edu
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/