Style Sheets
Thomas Dowling
tdowling at ohiolink.edu
Sun Sep 7 11:23:28 EDT 1997
----------
> From: Andrew J. Mutch <amutch at tln.lib.mi.us>
> To: Multiple recipients of list <web4lib at library.berkeley.edu>
> Subject: Style Sheets
> Date: Saturday, September 06, 1997 8:25 AM
>
> A couple of questions...
>
> I have been trying to implement the use of style sheets as the specs. for
> HTML 4.0 indicate that many of the current formatting elements under HTML
> 3.2 may not be available under future versions of HTML.
>
> 1) Style Sheets seem to work well for those formatting elements like
> background, fonts, margins, etc. that are consistent from page to page
and
> allow for standardization and easy administration of web pages. However,
> for individual elements, am I the only one that thinks Style Sheets seems
> to be more work than its worth? I can't imagine trying to identify all
> the potential style elements among a group of pages, creating an
> identification system for them and then writing the code to implement the
> style. Can someone enlighten me as to benefit or thinking behind this
> system?
I'm not at all sure I see the problem here. A style sheet can be used to
define the default appearance for any element. If you'd like to suggest
that all the <EM> elements in a page have a yellow background (like a
highlighter), you simply write that into the stylesheet--EM {background:
yellow}--and that's it. If you'd like to apply this highlighting only to a
subset of your <EM> elements, you define that as a new
class--EM.highlighted {background: yellow}--and then add the necessary
class attributes only to the EM tags you wish.
I don't see the use of stylesheets as being a commitment to define the
appearance of every element in every page on your Web site; browser
defaults aren't usually *that* atrocious. But if you find yourself
defining many of them the same way, you might find it easier to apply the
styles you like to the BODY element and let other elements inherit them.
Our site, for example, uses a single linked stylesheet for almost every
page on the site, so we certainly don't have to go through page by page and
identify styles we want to define. Then we get most of what we want out
of:
BODY {font-family: Arial, Geneva, Helvetica, sans-serif;
background: #FFFFFF}
(I know: dull, but legible.)
>
> 2) When printing out pages that utilize style sheets(linked external
> files) none of the formatting appears. Because I'm only using style
> sheets for basic elements like background and font, this isn't a big deal
> but what about when pages with very complex margins, etc. are created and
> suddenly become jibberish in printed form...or is hard-copy a past
> technology??
You don't mention what browser you're using. Despite a year's worth of lip
service by Microsoft and somewhat less than that from Netscape, neither of
the Big Two handles CSS completely, and I'm not surprised to hear about
printing discrepancies. IE 3.x is the worst, NC 4.x is somewhat better,
and IE 4.x is the best of those three browsers, IMO. Opera recently
promised that they would support CSS completely in a version due around the
end of the year (and even though they'll support JavaScript by then, you
won't have to enable it just for CSS support).
Thomas Dowling
Ohio Library and Information Network
tdowling at ohiolink.edu
More information about the Web4lib
mailing list