Improve Site Performance Increase Site Traffic Monitor Site Uptime Webmaster Resources NetMechanic Home Looking For Help? Partner Programs Privacy Policy Contact Us Press Room
NetMechanic Home LOGIN | HELP | ABOUT US | PRODUCTS | SITE MAP
NetMechanic Menu
Over 52 Million Web Pages Tested!     
 

Search for:


Your Email:

I would like to receive my newsletter in:
HTML format
Text format



Volume 8 (2005)
   September
   June
   April
   March
   January

Volume 7 (2004)
   November
   September
   July
   June
   May
   April
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 6 (2003)
   December
   November (Part 2)
   November
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 5 (2002)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 4 (2001)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 3 (2000)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June
   May
   April
   March
   February
   January

Volume 2 (1999)
   December
   November
   October
   September
   July
   June
   May
   April
   March
   February
   January

Volume 1 (1998)
   December
   November
   October
   September

 

CSS Tip:
Missing Style Sheets in Netscape

by Tom Dahm,
Chief Operations Officer,
NetMechanic, Inc.

  
May 2000
Vol. 3, No. 5
 • HTML Tip
 • CSS Tip
 • Beginner Tip
  

Using linked style sheets is a great way to simplify site maintenance. But if you use this technique be sure you check your links regularly. If you don't, visitors using Netscape Navigator may not be able to load your site at all!

Style sheets are a huge leap forward in Web design, allowing you precise control over the look and feel of your pages. If you work with Style Sheets often enough, sooner or later you'll start reusing the same styles between your pages. You can easily do this by using the LINK tag to tie an external style sheet to your page, like this:

<LINK REL="stylesheet" 
   HREF="mystylesheet.css" TYPE="text/css">

This tag tells the browser to look for a separate file called "mystylesheet.css" that contains a series of style rules. If it finds this file, it applies these rules to your page.

For example, suppose you had the following Web page, called mypage.html:

<HTML>
<HEAD>
   <STYLE>
   .redtext   {color : red}
   </STYLE>
</HEAD>
<BODY>
   <P CLASS="redtext">
   This text should be red.
   </P>
</BODY>
</HTML>

Instead of defining the style sheet within this page, you could move your STYLE tag into mystylesheet.css and reference it from mypage.html, like this:

mystylesheet.css:

   .redtext   {color : red}

mypage.html:

<HTML>
<HEAD>
  <LINK REL="stylesheet" 
    HREF="mystylesheet.css" TYPE="text/css">
</HEAD>
<BODY>
   <P CLASS="redtext">
   This text should be red.
   </P>
</BODY>
</HTML>

Notice that the file mystylesheet.css doesn't include the STYLE tag itself. Since we told the browser that this file is a style sheet within the LINK tag, we don't need to put the STYLE tag in the file itself. In fact, if we do so, the style sheet won't work properly.

Using the LINK tag makes sense, since it minimizes your site maintenance workload. If you decide to change your site's style, having all your styles in one central file can make life a lot easier. Instead of editing every page in your site, just edit the style sheet and the changes carry forward to every page in your site.

There's one big negative to this approach, though: if you use it, you need to be very, very sure the style sheet file actually exists on your Web site. If you don't, Netscape Navigator will refuse to load your page. Instead, the browser will display the dreaded "404 - File Not Found" error message.

This can be an especially aggravating problem when you first run into it, since it's not obvious that the style sheet is the cause of the problem. Check the browser's Location field; if the style sheet is the cause you'll see its address there, instead of the address of your Web page.

This problem can be hard to spot if you use Microsoft Internet Explorer as your primary browser because MSIE forgives this error. If it doesn't find your style sheet, it loads your page anyway, without using your custom style. You may not get the style you wanted, but at least your page loads.

The best way to prevent this problem is to check your links regularly. Our HTML Toolbox service will tell you if you have missing style sheets.



Rate This Tip:
Not Useful Useful Very Useful   
 
NetMechanic Tools
HTML Toolbox
Browser Photo
Server Check
Search Engine Starter
Search Engine Tools
GIFBot
Newsletter
HTML Tutorial and Tips
Search Engine Tutorial
Accessibility Information
Browser Problem Tutorial

Company Info
Products
About Us
Contact
Advertise
Link To Us
Jobs
Privacy Policy
Partner Programs
Press Room
RSS Feed
Support
 



Powered by Overture!

 
     
 
   
 
     


Keynote Home
Copyright © 1996-2007,
Keynote NetMechanic
All rights reserved.