May<-- Jun 2024 -->Jul
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6

Disclaimer: The entries you find in these pages are based on my individual opinions and thoughts. Some of the entries may be just plain wrong, and others harmful. Should you choose to act on, or try, anything you find on this site, you assume any and all risks associated with your actions. So there.


mime types Matter

March 18, 2004

I was throwing up a placeholder splash-page for a website that has been dormant for a few years, but is finally under design. The page is simply one big graphic with a mailto link on it. I wanted to have a hover affect over the link, and wanted to use CSS to pull it off. No sweat, I thought, I've done this plenty of times before. So off I went to hash together the dozen or so lines of CSS needed.

I tested in Safari first: great; then IE 5.2 Mac: great; then Netscape 7.1 Mac: nothing. What? Netscape has always tracked pretty well with Safari (or vice versa), but suddenly Netscape was behaving as if there was no stylesheet at all. I tweaked, look for typos, and tweaked again. Then I tried a few very basic things (black background) and realized that Netscape was just plain ignoring my CSS. I spent over an hour trying to figure it out. Even IE 6 Win XP and IE 5.5 Win ME recognized it.

I gave up and went downstairs. Three hours later I decided to take a different tack. I ran the page, simple as it was, through the W3 xhtml validator: it validated. Huh? So I took a flyer and ran it through the W3 CSS validator: failed with an error "CSS can't be imported from an HTML file." Whoa, first clue: server related. The server I was running on is our oldest server, in use for several years and running an old version of WebSTAR. The site won't live there when it goes live, but no sense in moving a still dormant site to a new server.

A quick review of the mime types in the server admin program revealed no default type for .css files; they were going out as the default text/html. I added text/css for .css files and the page validated and Netscape work flawlessly.