HTML and CSS Reference
In-Depth Information
EXAMPLE 14.10 ( CONTINUED )
</style>
</head>
<body>
3
<h1 style="color:darkred;
text-align:center;
text-decoration:underline;" >Inline Stylin'</h1>
4
<p style="color:black;
background:white;
font-family:sans-serif;font-size:large">
This paragraph uses an inline style. As soon as another
paragraph is started, the style will revert back to its
default.
5
<p> This paragraph has reverted back to its default style,
and so has the following heading.</p>
<h1>Default heading</h1>
</body>
</html>
EXPLANATION
1
A CSS starts here in the head of the document.
2
The background color is set to orange and the color of the font is set to dark blue.
3
This h1 uses an inline style, an attribute of the <h1> tag and effective for this head-
ing only. The color will be red, the text centered and underlined.
4
This is an inline style for the paragraph tag. It is an attribute of the <p> tag and is
only good for this paragraph. The text of the paragraph will be black, the back-
ground color of the paragraph will be white, and the font family, sans serif, large.
The next time a <p> tag is used, the style will revert to its former style.
5
This paragraph has reverted to its former style. See Figure 14.12.
Figure 14.12 Inline styles are temporary.
 
Search WWH ::




Custom Search