Help: Linked Style Sheet Not Found with Relative Path

C

Carolyn

I've come across a problem in FrontPage 2002 that I
haven't been able to resolve: Styles are not displayed
within FrontPage when linking to a style sheet that uses a
single slash in the relative path. (The pages display
just fine when viewed from the web server.)

Here's an example of the local directory structure for one
of our departments: Department Web Site/academic/hss.
The style sheet is located in the root folder (i.e.
Department Web Site) and the web pages are located in the
hss folder. The site is not configured as a FrontPage
Web.

Example - doesn't work:
<link rel="stylesheet" href="/style-01.css"
type="text/css">
Example - does work:
<link rel="stylesheet" href="../../style-01.css"
type="text/css">

Formerly, all of our web pages were coded with ../../ so
we didn't run into this problem. However, when we recoded
certain segments of our web site, we used just the single
slash.

Any clues on how to get FrontPage 2002 to recognize the
style sheet? (Here are the things I tried: Created a
FrontPage Web for this site to see if this would fix the
problem, but no luck. Checked Microsoft's Knowledgebase,
but couldn't find anything there. I do have all of the
latest Windows and Office updates and service packs on my
PC.)

FYI... DreamWeaver MX 2004 didn't have a problem with the
single slash as long as a site was defined. I did find a
way to get this site to work in FrontPage 2003. (For some
reason, you have to establish a link to the style sheet in
2003; it doesn't seem to be able to find the style sheet
based upon the code. To establish the link, you have to
choose Format/Style Sheet Links from the menu. Then click
the Add button and use the Browse button to select the
style sheet. Click OK. Finally, click the option for All
Pages.) Although I can get this to work in FP 2003, I
would like to find a solution for FP 2002 if at all
possible (in case someone prefers not to upgrade).

Thanks.
 
M

Murray

The question is - where is the stylesheet?

Is it at the root of the web? If it is then the first link will work -

<link rel="stylesheet" href="/style-01.css"

Is it two levels above the current file? If it is then the second link will
work -

<link rel="stylesheet" href="../../style-01.css"

That's always the consideration. It's not dependent on how many slashes you
use as an arbitrary thing. It's how do you have to navigate to get from the
current page to the linked file. A leading slash always says to start at
the root of the web and follow the path from that location. A leading dot
pair slash always says to start with the current document and follow the
path from that location.
 
C

clintonG

Talk to the person(s) who administer the web server as many
hosting providers are disabling support for the 'parent path'
which is why using ../../ may no longer be functional.
 
R

Ronx

Where are you testing this? In the live web the /style-01.css should work,
in a local web (on your PC) it probably will not.

If in a local disc-based web, the leading / points to the root of the disc
drive, not the root of the website.
If in a subweb of a server-based web, the / points to root of the webserver,
not the root of the subweb.

When you use Format->Style Sheet Links FP2003 sets up a relative link to
the style sheet in the form ../../style-01.css, the same as in previous
versions. It is an absolute link until the page is saved, then becomes
relative.

Ron
 
C

Carolyn

-----Original Message-----
Where are you testing this? In the live web the /style- 01.css should work,
in a local web (on your PC) it probably will not.

I'm testing this on my PC, not the server. I need the
user to be able to see and select the styles from within
FrontPage. However, since FP cannot find the style sheet,
it does not show the styles from the linked style sheet in
the Style drop-down menu.
If in a local disc-based web, the leading / points to the root of the disc
drive, not the root of the website.
If in a subweb of a server-based web, the / points to root of the webserver,
not the root of the subweb.

Even if I place the style sheet in the root of the drive,
it still cannot find the style sheet.
 
R

Ronx

In a disc-based web FrontPage won't see the style sheet except in preview,
or preview in browser, since the style sheet is not in your web. As a
workaround, you could place a copy of the style sheet in your web, and link
to that, then when the page is finished correct the link to sheet. That
last step is, however, easily forgotten.

In a server based web FrontPage does pickup styles from other subwebs,
including the root web.

Ron
 
C

Craig Schiller

Carolyn -

Why not just copy the style sheet so it's in both locations/folders?

Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top