Selector Schemes


To give you enough freedom to select which elements a style is applied to, CSS2.1 supports four selector schemes. Each is based on some aspect of an element:

  • An element's type

  • An element's attributes

  • The context in which the element is used

  • External information about the element

Also, CSS2.1 includes a way of attaching style rules to an element without using a traditional selector; the STYLE attribute effectively bypasses the entire selector mechanism.

The four schemes can be combined in a single selector to put style properties on elements that exhibit a combination of characteristics. For example, the selector H1 EM uses element types (H1 and EM) and context (EM must be inside H1).



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net