Netscape cannot find my external stylesheet!!!

liunx

Guest
Netscape/Mozilla is not finding/respecting my css style sheet.

I am new at this, so there is much I do not understand about web authoring. Please, therefore, do not assume in your reply that I will understand the web shorthand that you experienced authors comprehend.

I am developing a web site on my local machine using an HTM source code editor and a separate css editor. The object is not only to develop the site but to learn as much as possible about the code writing required.

I think I have done everything right. My pages takes less than 15 seconds to load at 56 bps. My graphics files have been reduced to groaningly small sizes using a jpeg optimizer. My external css file has been validated by W3 and has no errors.

In IE6, everything works well and looks good. Netscape 7.1, however, does not seem to be finding my css style sheet or any images. I suspect I do not understand how relative addressing works in Netscape.

Here is the heading code that I think has relevance to this problem:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<base href=http://www.webdeveloper.com/forum/archive/index.php/"c:/my documents/starcraft web site/">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href=http://www.webdeveloper.com/forum/archive/index.php/"stylesheet.css" rel="stylesheet" type="text/css">

I have also tried <link href=http://www.webdeveloper.com/forum/archive/index.php/"c:/my documents/starcraft web site/stylesheet.css" rel="stylesheet" type="text/css">

which also has no effect.

Once again, this works properly in IE, but not in Netscape.

Any information about what I am doing wrong would be appreciated.Hi!

As long as you are having your stuff on a local harddisk, just do this:

<base href=http://www.webdeveloper.com/forum/archive/index.php/"file:///c:/my documents/starcraft web site/">

Will work in IE and Mozilla...

Cheers - PitYes, indeed. That did the trick.

Many thanksHi!

You're welcome! :D

Cheers - PitIt is not a good idea to use absolute file referencing (the entire directory tree).

the best thing to do is to have the CSS style sheet in the same directory as all your .html files that way you do not have to include the directory (this is called relative file referencing)

smercerSome simple rules about relative file paths:

1. Relative file paths, or URLs, are all taken in reference to what folder the browser grabbed the HTML file from. So if you view your Web site's home page, it grabbed it from c:/my documents/starcraft web site/, and that's the folder the browser uses to judge relative file paths.

2. /foldername/ will cause the browser to start looking for files in the Web site root directory. If you are developing on your local machine, the root directory is c:\ for PCs.

3. "../foldername" tells the browser to go UP one folder, then go inside "foldername."

4. foldername/index.html tells the browser to go inside a folder called "foldername"

In short:

* Typing the file name, like <a href=http://www.webdeveloper.com/forum/archive/index.php/"file.html"> tells the browser to search for file.html in the same folder it grabbed the current page.

* "../" before the file or folder tells the browser to go UP one folder.

* "/" before the file or folder name tells the browser to start searching in the Web site's root directory.

Head to my personal site to get a better explanation of relative URLs: <!-- m --><a class="postlink" href="http://users.tm.net/gburghardt/webDesign/html/5-images/index.html">http://users.tm.net/gburghardt/webDesig ... index.html</a><!-- m -->

It's something you will need to know if you get into Web design. It seems confusing at first, but it's easy once you think about it.
 
Back
Top