HTML and CSS Reference
In-Depth Information
The style sheet starts with the HTML <style> tag and specifies that the style sheet
consists of text and CSS. The purpose of this style sheet is to customize HTML
tags, thus giving them a new style.
A selector is one of any HTML elements, such as h1, h2 , body, li, p, or ul. In this
example, the h1 and h2 elements are selectors. The declaration has two parts:
property ( color ) and value ( saddlebrown ). Every time an <h1> tag is used in the
document, it will be saddle brown, and every time an <h2> tag is used, it will be
blue. (There are approximately 50 properties beyond the color property that are
defined in the CSS specification!)
The <h1> tag will be displayed in saddle brown, based on the rule in the style
The <h2> tag will be displayed in blue, based on the rule in the style sheet. Output
is shown in Figure 14.1.
Figure 14.1 Style sheet output in Firefox.
14.3 CSS Program Structure
CSS comments, like C language comments, are enclosed in /* */. They are the textual
comments that are ignored by the CSS parser when your style is being interpreted, and
are used to clarify what you are trying to do. They cannot be nested.
H1 { color: blue }
/* heading level 1 is blue */
Search WWH ::

Custom Search