HTML and CSS Reference
In-Depth Information
For instance, the following display background will be black, not white or
gray, even though you specify both white and black values in the rule:
body {background: white black}
Current styles-conscious browsers ignore letter case in any element of
a style rule. Hence, h1 and h1 are the same selector, and COLOR, color,
ColOR , and cOLor are equivalent properties. At one time, convention dic-
tated that HTML authors write selector names in uppercase characters,
such as h1, P , and STRONG . This convention is still common and is used
in the W3C's own CSS2 document.
However, current standards dictate, particularly for XML-compliant doc-
uments, that element names be identical to their respective Document
Type Definitions (DTDs). With XHTML, for instance, all element names
are lowercase (e.g., h1, p , and strong ), so their respective CSS2 select-
ors must be in lowercase. We abide by the latter convention.
Any valid element name (a tag name minus its enclosing < and > char-
acters and attributes) can be a selector. You may include more than one
tag name in the list of selectors, as we explain in the following sections.
8.2.2. Multiple Selectors
When separated by commas, all the elements named in the selector list
are affected by the property values in the style rule. This makes life easy
for authors. For instance:
h1, h2, h3, h4, h5, h6 {text-align: center}
does exactly the same thing as:
h1 {text-align: center}
h2 {text-align: center}
h3 {text-align: center} h4 {text-align: center}
 
Search WWH ::




Custom Search