Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with linking external css style sheet.

Posted on 2006-07-11
3
Medium Priority
?
432 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 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

971 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