开发者

Web: What's the correct path to CSS?

i have this structure in my project

Web: What's the correct path to CSS?

I have this page 27.html, so i have to find the CSS file, so i think the correct path was :

<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<link href="../../../css/inner.css" rel="stylesheet" type="text/css" />

开发者_运维问答But it's not working, so i wonder why this happens..

Any idea ?

UDPATE: Hi guys, this is my URL: /web/blog/2011/june/27.html

I'm trying

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

But still not applying the css in the page.

Best regards, Valter Henrique.


Why not just use the root as a reference?

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


You need to specify your path from the root URL to make this easier, with the '/' at the front.

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


You only need two ../.

Try this:

<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<link href="../../css/inner.css" rel="stylesheet" type="text/css" />


You could always just do this to get to your web root:

<link href="/css/style.css">

Rather than fiddling with relative paths, go absolute.


Your paths look OK, are you sure the CSS files were uploaded to your server and that the file names are actually correct?

In doubt with ".." navigation, move your files closer and do some trials and error until you get it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜