Solved

Problem with linking external css style sheet.

Posted on 2006-07-11
3
421 Views
Last Modified: 2008-02-01
I'm having a little trouble linking some style sheets in some web pages I'm building.  I want to have the stylesheets one directory level above the web pages(see diagram), but I don't seem to be able to do it.  I've tried to link using both the following:

//Fully qualified
<link rel="stylesheet" type="text/css" href="http://localhost/LockOut/css/proof_page.css">

//Relative

<link rel="stylesheet" type="text/css" href="../css/proof_page.css">


The sheets work when they're in the same directory as the pages or any directory below them.


<-------------------------DIAGRAM---------------------------->
                                                                                       
                                                        ----------------------css--------------style.css
                  ---------------------LockOut
root website                                      ----------------------pages-----------individual pages
                  ---------------------other sites


Thanks in advance for the help.

~pcjunky
0
Comment
Question by:pcjunky
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
inviser earned 125 total points
ID: 17083857
Try using a virtual path:

<link rel="stylesheet" type="text/css" href="/LockOut/css/proof_page.css">

Also, make sure you check over eveything again and look for simple problems. From what I can see, you have the right idea and it should work fine, so make sure you double check everything.
0
 

Author Comment

by:pcjunky
ID: 17084055
That didn't seem to work either.  As another note the webpages are in a directory that is protected via web.config.  But I've made the path of the css allow users = "*"
0
 

Author Comment

by:pcjunky
ID: 17084151
Well it works now.  I retyped the entire <link line.  All I can think is that I had some sort of typo in the html or the href.  Anyways the I ended up using the following (in case someone else needs to know):

<link rel="stylesheet" type="text/css" href="..\css\proof_page.css">

I'm going to award you inviser with the points (it doesn't seem right refunding the points for my silly mistake).  Thanks.

~pcjunky
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now