1

I have a CSS link that looks like this:

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

But now I want the CSS directory not to be linked to as "../../", but as "~/", i.e from the top of the project.

So I changed the CSS call to:

<link href="~/project/css/WW/parts.css" type="text/css" rel="stylesheet" />

But what happens is that the path is added to the current paht, instaed of going to the top of the project:

http://localhost:3333/Project/Apps/WW/~/project/css/WW/parts.css

What am I doing wrong? What's the right way to go about this?

2 Answers 2

3

Normally, "top of project" means the document root. If you're trying to do that, try:

 <link href="/project/css/WW/parts.css" type="text/css" rel="stylesheet" />

If not, start pathing to the CSS from whatever directory / uses.

Sign up to request clarification or add additional context in comments.

Comments

1

AFAIK ~ is for the server to resolve the URL. If you wan't this, then you need to add runat="server" to the link element. [Edit] Seems that you don't need runat="server", the server will resolve ~ by itself, giving you the "../../path".

A better solution would be "/css/WW/parts.css" :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.