开发者

relative url html

How do i reference a开发者_如何转开发 file template.css from index.php . This file is located within the folder "css" where index.php and css are at the same level.

index.php

css -> template.css

css/template.css 

does not work


Have you tried anything?

Try following things:

  1. ./css/template.css
  2. /css/template.css
  3. css/template.css


This should work ./css/template.css. ./ refers to the current working directory.
This also works: /css/template.css, but there might be a problem in some unix systems as / usually refers to the root folder (of the project).


Are you linking the .css file correctly?

<link rel="stylesheet" href="css/template.css"/>

in the <head> tag.

If so it could be that the permissions are incorrect on the .css file. Check that the .css file can be read by the user that the web server runs as.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜