HTML and CSS Reference
In-Depth Information
For instance, the following style tells the browser to display the level-1
header text, "I'm so bluuuuoooo!", not only in the
<h1>
tag style, but
also colored blue and italicized:
<h1 style="color: blue; font-style: italic">I'm so bluuuuoooo!</h1>
Inline styles can be difficult to maintain, because they add more con-
tents to their tags' definitions, making them harder to read. Also, be-
cause they have only a local effect, they must be sprinkled throughout
your document. Use the inline
style
attribute sparingly and only in those
rare circumstances when you cannot achieve the same effects other-
wise.
8.1.2. Document-Level Stylesheets
The real power of stylesheets becomes more evident when you place a
list of presentation rules at the beginning of your HTML or XHTML doc-
ument. Placed within the
<head>
and enclosed within their own
<style>
and
</style>
tags,
document-level stylesheets
affect all the same tags
within that document, except for tags that contain overriding inline
style
attributes.
[*]
[*]
XHTML-based document-level stylesheets are specially enclosed in CDATA sections of your docu-
ments. See
section 16.3.7
in
Chapter 16
for details.