XML technologies / CSS / CSS Cookbook / General information / Different selectors for assigning styles / Type selectors
(Excerpt from “CSS Kochbuch” by Christopher Schmitt)
The term type selectors refers to selectors that name a specific element or HTML tag to which styles should apply. The following rules define specific font styles for the h1 and p elements on a web page (see the following figure):
h1 {
font-size: 120%;
}
p {
color: blue;
}Figure: HTML elements to which the CSS rules apply.
Note:
Note that some elements inherit property values from their parent elements. Thus, not only the paragraph text turns blue, but also its contained em element.
Copyright of the German edition © 2007 by O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “CSS Kochbuch” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstr. 81, 50670 Köln
back to top