Skip to: content, navigation

by Tommy Olsson and Paul O’Brien

Rule Sets

A rule set (also called a rule) comprises a selector followed by a declaration block; the rule set applies the declarations listed in the declaration block to all elements matched by the selector.

Here’s an example of a rule set:

h2 {
  color: #666;
  font-weight: bold;
}

User-contributed notes

ID:
#4
Date:
Tue, 29 Jan 2008 13:00:22 GMT
Contributed by:
pmmueller
Status:
This note has not yet been confirmed for accuracy and relevance.

The term "rule set" is used in the CSS spec and should of course also be used here, but wouldn't it be possible to include a note that a "rule set" commonly is known as a "style"?

It sounds less frightening to newcomers and even adds meaning as it becomes more obvious that "selector plus declaration block" is a "style", which is part of a "style sheet".

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters