View Single Post
Old 02-21-2011, 04:20 PM   #79
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
"Selectors" are simply the "identifiers" in a CSS definition that determine which elements in the HTML should have the specified CSS style applied. "Classes" are user defined labels which can be applied to HTML elements to make it possible to define selectors that involve just a subset of one or more elements.

Take the following example CSS code:
Code:
h1 {font-weight:bold}
p {text-indent:2em}
p.noindent {text-indent:0}
In the CSS example above:
  • "h1" is a selector which determines which elements in the HTML will have the CSS formatting "font-weight:bold" applied;
  • "p" is a selector which determines which elements in the HTML will have the CSS formatting "text-indent:2em" applied;
  • "p.noindent" is a selector which determines which elements in the HTML will have the CSS formatting "text-indent:0" applied.
This last selector involves the use of a class "noindent", which makes it possible to specify different formatting for a subset of "p" elements.
DMSmillie is offline   Reply With Quote