sundot home page unix consulting in the uk and mainland europe (archives)
home | about sundot | unix | downloads | archives›date | archives›subject | external links

A better way of sourcing your stylesheets (older browsers like Netscape 4.7 display something instead of nothing).

posted by hal 20030117 (archived) | permalink | path | initial version: 20030117

Rolf Kersten complained about not being able to see anything on our home page when using Netscape 4.7 on Solaris. Both the HTML and CSS on this site is compliant and I have no intention to code HTML to cater for specific browsers (it's a total waste of time). The crude Netscape 4.7 browser is the one shipped with Solaris 8 so it still was a slight consern. Luckily there is a way of getting non-CSS browsers to at least display something.

All the
<link rel="StyleSheet" href="/common/sundot.css" type="text/css" media="screen" >
in the head section of the html was first changed to
<style type="type="text/css" media="screen";>@import "/common/sundot.css";</style>

This tip is found in the article HTML Utopia - Designing Without Tables by Julian Carroll.

Using style type had the rather unfortunate effect of the style sheets not loading in IE 5.5 (although Netscape 4.7 came to life). Coding for different browsers is a nightmare. The strictly coded Pete's Guide is a good example on how coding should be done (and you can also test your browser for standards compliance). Pete's Guide home page generates a "Runtime Error" in IE 5.5 - but continues to load and Netscape 4.7 also loads the page (garbled of course). Noting how Pete has done the link rel= I shuffled around the parameters. Now IE 5.5 (with CSS) and 4.7 both seem to work (as well as modern browsers). So currently the stylesheet is loaded like this
<link rel="stylesheet" media="all" href="/common/sundot.css" type="text/css">


Creative Commons
 License Valid HTML 4.01! Valid CSS! Powered by Blosxom!
All content on this website is governed by a Creative Commons license.