| home / new / font |
|
What's the best way to implement style sheets? You should create a separate style sheet for each platform and/or browser, according on how much control you want to have. This is much easier than creating a different HTML file for each platform. Plus, if you want to quickly change the look of your site, you simply change the style sheet(s). (Ed. note: We prefer one style sheet that's a compromise across platforms, with relative font sizes.) Here is an example of two different style sheets for Windows and Mac OS, stored in text files called "win.css" and "mac.css". These are simplified versions of style sheets I use on my site at www.stevestv.com:
There are several things you should take note of about these style sheets.
Finally, here's how to tell your page to use a different style sheet depending on the browser or platform. This can probably be done with JavaScript, but I found it easier to do with Apache's Server Side Includes, supported by most Web servers. In the <head> of your document, put something like this:
Remember, IE 5 for Mac renders fonts at 96 dpi by default. So this SSI essentially says, "If this is a Mac, but not IE 5, load the Mac style sheet. Otherwise, load the Windows style sheet." If you wanted to load a different CSS file for Netscape, you would add another line that says, "If this is Windows and Netscape 4, load 'netwin.css'" (or whatever). In a world dominated by Windows and Internet Explorer, it's tempting to just design for one platform and not bother with the rest. By doing that, however, you not only reinforce Microsoft's monopoly, but you risk alienating visitors to your site, and potential customers of your business. At a minimum you should test your site regularly on other platforms. I currently design on Windows and test my site using an excellent Mac emulator, Basilisk II. And if you've never tried style sheets, it's worth experimenting. The principles I've outlined can also be applied to other situations, such as making your site more compatible with wireless devices or WebTV. More resources: Building Characters: A Brief History of the Web War -- an exellent Tidbits article explaining font issues in depth. See Microsoft's Typography on the Web for lots of font and CSS info. Just try to avoid stuff that only works on IE! Use the WebTV Viewer to see how your site might look on a set-top box. Wes Reimer has been designing Web sites since 1996. He is currently the Webmaster at Steve's TV, an electronics retailer in Ontario, Canada. He loves to talk about fonts! Drop him a line at wes@stevestv.com. Further Reading
This article originally appeared in the December 14, 2000 edition of the WebReference Update Newsletter. |
Comments are
welcome
Written by Marsha Glassner and
Revised: Dec 26, 2000
URL: http://webreference.com/new/font/2.html