|
Cascading Stylesheets (CSS)
The most important recent development in formatting Web pages is the
World Wide Web Consortium's (W3C) cascading stylesheets (CCS)
standard. (The Consortium is the official body that governs HTML standards.)
Stylesheets will offer Web designers the ability to apply "styles" or
"formatting tags" to HTML pages very much the same as desktop publishing
programs do now. The key word in the previous sentence is will.
Since only the very latest (4.0 or later) browsers FULLY support stylesheets,
you may not want to knock yourself out learning this new technology until
you've mastered the basics of designing with standard HTML code.
However, sooner or later we'll all be using CSS (and its accompanying
technology DHTML) to make our Web pages more interesting and more interactive.
- Like their desktop-publishing cousins, cascading stylesheets allow
Web publishers to streamline design by applying font, color, weights,
sizes, and margin choices to several pages at once--a huge savings
in coding time.
- Stylesheets, when combined with Dynamic
HTML (DHTML), allow designers to layer words and graphics, while simultaneously reducing download time.
- You can store stylesheets inside your HTML documents or in separate
files on the server. You can change the look of an entire site by
changing a single file. You could even offer users the option of defining
their own styles, which get "cascaded" onto the Web site, replacing
current styles. For example, you might have a style for people who
are visually impaired that changes fonts or makes text bigger or even
changes voices and intonations on a screen reader.
If you use stylesheets now, be sure to test, test, test
your pages in older browsers before publishing. Since the 4.0 browsers
are now absolutely free, folks really don't have much excuse for not
using them, but surveys show that a small number of surfers still
use older browsers as well as text-only browsers that don't understand
CSS codes.
Using stylesheets to eliminate graphic files
Using ordinary HTML coding, the only way to be sure every viewer
will see your text exactly the way you want it to look is to transform
it into a graphic (GIF or JPEG). An important advantage of CSS is the
ability to give text a specific appearance without converting it to a
graphic.
What's wrong with using graphics to display text?
- Graphics take up dramatically more space than text, which makes Web pages take longer to load
- The text stored inside graphics can't be indexed by Web search engines like Infoseek
- Text stored in graphics doesn't get bigger or smaller when the user
changes the browser's font size
- Blind people, who rely on screen readers to browse the Web, are utterly locked out by text stored in graphics.
Of course there are workarounds. You can use the alt tag to
store words that appear inside a graphic. Or you can create a "text-only"
version of all your Web pages--alternate sites for the visually
or bandwidth-impaired.
Using stylesheets to replace tables
You may wonder why anyone would want to find a substitute for tables. Well, stylesheets would solve two problems inherent in tables:
- First, there are just a whole bunch of layout tricks that cannot
be coded with tables. "How do you do leading in HTML? Poster fonts?
Drop caps?"
- The second problem is that it's virtually impossible to reassemble
the original text flow once text has been chopped up into HTML table
cells.
How long will it be before everyone is using stylesheets?
It will probably be six months to a year before all surfers are using browsers that support stylesheets. So you need to proceed cautiously for the time being. Some adventurous Web developers are already using stylesheets, and apparently the CSS standard will be a strong part of the Web's future. It was introduced in Internet Explorer 3.0 and now is supported by Netscape's Communicator 4.0, though the two browsers don't necessarily handle CSS coding in the same way.
You'll be pleased to know that many HTML editors (even the cheaper ones like HotDog Pro and Homesite) will help you create stylesheets (as well as DHTML, JAVA applets, Javascript, etc.), so you can easily experiment with this new technology. Just remember that older browsers will not be able to display pages defined with Cascading stylesheets--at least not the way you might expect. So test, test, test.
|