Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with linking external css style sheet.

Posted on 2006-07-11
3
Medium Priority
?
430 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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…
Suggested Courses

722 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