Re: CSS Question: # vs . (lb sign vs. period)

by "Paul Wilson" <webguroo(at)tampabay.rr.com>

 Date:  Tue, 9 Jan 2001 09:21:43 -0500
 To:  "Rob Atkinson" <robatkinson(at)nucleus.com>,
<hwg-techniques(at)mail.hwg.org>
 References:  nucleus
  todo: View Thread, Original
> This is new to me and it appears to work, sort of. They use "ID"
> instead of "Class" in most of their coding and there are other
> areas where both, the HTML and the CSS are invalid. Makes it
> tougher to sort it all out.
>
> Would anyone have any info or links to info, on the use of the
> (#) in CSS and its validity?

. and # are ATTRIBUTE selectors. CLASS attribute uses the period. The # is
for the ID  attribute selector.  Conversly TYPE selectors are CSS  elements
for standard markup like H1 or BODY.

CLASS and ID work similar to TYPE element except they are intended for
controlling parts of a page requiring more specific control. CLASS and ID
work the same except that an ID is unique to that element on the page.
CLASS can be used several times with different elements.

If you have products price in 12px bold in the color gold, you can only use
this element once on the page if it is an ID.  If it is a CLASS you can use
it as many times as you need it in the page.

http://www.awlonline.com/cseng/titles/0-201-41998-X/liebos/ch3/ch3.html


Paul Wilson
webguroo(at)tampabay.rr.com

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.