• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

11. Managing Style Sheets > 11.2. Assigning Style Sheet Rules to a Subgroup of ...

Assigning Style Sheet Rules to a Subgroup of Elements

NN 4, IE 4

Problem

You want a mixed group of elements (of the same or different tag name) in a document to be governed by a single style sheet rule.

Solution

Use a class or contextual selector in your style sheet rule definition. If you use a class selector, the rule is applied to every element in the document (regardless of tag name) whose class attribute is assigned the arbitrary name you use for the class definition. A class selector name in the style sheet definition is preceded by a period, as in the following example:

.hot {color:red; text-decoration:underline}

But the period is not used in the class attribute assignment statement in the tag:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint