XML technologies / CSS / Advanced websites with CSS / Behind the scenes / Selectors and the structure of CSS rules

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

As explained in Parts of a CSS rule, each style rule has two parts: a selector that specifies the HTML element for the rule, and a series of property and value declarations defining the CSS style.

So far, we have considered only selectors containing a single HTML element:

h1 {
  font-size: 120%;
  text-transform: capitalize;
}

However, selectors can also contain several HTML elements:

h1, h2, h3 {
  font-size: 120%;
  text-transform: capitalize;
}

The following pages examine all types of selectors available in CSS.

  

  

 

 

 

back to top