Solved

Problem with linking external css style sheet.

Posted on 2006-07-11
3
423 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
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…

813 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

14 Experts available now in Live!

Get 1:1 Help Now