user544079
user544079

Reputation: 16629

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

Upvotes: 0

Views: 103

Answers (3)

Harry Joy
Harry Joy

Reputation: 59660

Have you tried anything?

Try following things:

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

Upvotes: 1

Anji
Anji

Reputation: 723

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).

Upvotes: 1

dalton
dalton

Reputation: 3696

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.

Upvotes: 0

Related Questions