HTML and CSS Reference
In-Depth Information
8.6. Applying Styles to Documents
You should consider several issues before, during, and after you use
styles in your web documents and document collections. The first, over-
arching issue is whether to use them at all. Frankly, few of the style ef-
fects are unique; you can achieve most of them, albeit less easily and
with much less consistency, via the physical and content-based style tags
(e.g., <i> and <em> ) and the various tag attributes (e.g., color and back-
ground ).
8.6.1. To Style or Not to Style
We think the CSS2 standard is a winner, not only over JavaScript-based
standards but also for the convenience and effectiveness of all of your
markup documents, including HTML, XHTML, and most other XML-com-
pliant ones. Most browsers in use today support CSS1 and many of
the features of CSS2. The benefits are clear. So, why wouldn't you use
Although we strongly urge you to learn and use CSS2 stylesheets for your
documents, we realize that creating stylesheets is an investment of time
and energy that pays off only in the long run. Designing a stylesheet for a
one- or two-page document is probably not time effective, particularly if
you won't be reusing the stylesheet for any other documents. In general,
however, we believe the choice is not if you should use CSS2 stylesheets,
but when .
8.6.2. Which Type of Stylesheet, and When
Once you have decided to use cascading stylesheets (for pain or pleas-
ure), the next question is which type of stylesheetinline, document level,
or externalyou should apply, and when. Each has its pros and cons; each
is best applied under certain circumstances.
Search WWH ::

Custom Search