Forum Moderators: not2easy

Message Too Old, No Replies

id versus class

         

paulpsd

10:55 pm on Nov 24, 2004 (gmt 0)

10+ Year Member



In a few tutorials, I'm noticing developers writing CSS starting with a "#" rather than a "." Then in the HTML, they refer to styles using id rather than class. I'm used to doing it as class:

.bodyText {
...
}

<p class="bodyText">bla bla bla</p>

Slade

11:30 pm on Nov 24, 2004 (gmt 0)

10+ Year Member



I think you're asking what's the difference, and when to use one over the other. If so, see:

CSS: ID versus CLASS attributes [webmasterworld.com]

paulpsd

11:49 pm on Nov 24, 2004 (gmt 0)

10+ Year Member



Thank you!