Use Cascading Style Sheets Selectors
ID Selectors
Another specialty selector is the ID selector. Like the class, an ID selector
is based on the value of an attribute, but in this case, it's the ID attribute. This
selector is used to single out a particular element; IDs should be unique within a
document. For example the following code in Listing 6 selects the span designated as
bestinshow
by preceding the name with a pound sign
(#
) and colors it red, as shown in Figure 5.
|
Figure 5. The ID selector selects a specific element
View Use Cascading Style Sheets Selectors Discussion
Page: 1 2 3 4 5 6 Next Page: Family relationships: descendants, children, and siblingsFirst published by IBM developerWorks