home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeWeb Design in a NutshellSearch this book

17.3. Selectors

Selectors are the parts of the rule that identify the element (or elements) to which the style will be applied. There are several methods for identifying elements.

17.3.3. class and id Attribute Selectors

Attribute selectors allow web page authors to apply style rules based on special identifying attributes placed within HTML element tags. There are currently two available attribute selectors: class and id. They can be applied to all HTML elements except <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. (In addition, class may not be used in <basefont> and <param>.)

17.3.4. Pseudo-Selectors

The CSS1 Specification provides several pseudo-elements and pseudo-classes that are not based on structural elements of a document. They can be used as selectors, but the code does not appear in the HTML source; rather, they are interpreted by the browser based on context and function. Pseudo-selectors are indicated by the colon (:) character. As of this writing, only Internet Explorer 5.5+ (Windows), Internet Explorer 5 (Mac), Netscape 6, and Opera support pseudo-selectors reliably.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.