Solved

Problem with linking external css style sheet.

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
css, html 5 52
JavaScript/CSS: Detect if hue-rotate supported by browser 1 51
Changing Color of Page Section 4 24
css selector 1 21
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…
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 define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

807 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