HTML and CSS Reference
In-Depth Information
EXPLANATION
1
The HTML <style> tag belongs within the <head></head> tags. The is the start of
an embedded CSS.
2
A rule is defined for the HTML body element. The background color of the docu-
ment will be light blue.
3
A rule is defined for the HTML p (paragraph) element. The left and right margins
are set at 20%, meaning that they will be moved inward 20% from their respective
edges. They will be surrounded by a grooved border, with the text given a 15-pixel
size padding. The font is Times or Arial (whichever works on your browser),
point size 150% bigger than its default, and weight 900 is the boldest of the bold.
4
A rule is defined for a group of selectors (heading levels h1 , h2 , and h3 ). They will
be centered on the page, and the text will be white against a blue bordered back-
ground in a Courier or Arial font.
5
The rule for the < h2> and <h3> tags sets the font size to 24 points.
6
A rule is defined for an em element. Text will be green and bold.
7
This marks the end of the HTML header that encloses the style sheet.
8
As shown in the output (see Figure 14.11), the heading level is displayed accord-
ing to the style defined in the style sheet, line 4.
9
This paragraph is displayed according to the rule set in the style sheet, line 3. No-
tice how both the left and right margins have moved toward the center.
10
The heading level is displayed according to the rule set in the style sheet, lines 4
and 5, and the first paragraph is indented.
11
The <em> tag is embedded within the <p> tag. It inherits from the <p> tag every-
thing but the font color and weight. These paragraph properties were overridden
in the style sheet defined on line 6 for the em element.
 
Search WWH ::




Custom Search