1

I am using WAMP and I have multiple site projects.

When accessing files within my CSS or HTML I'd like to use the root selector /index.html however this is not working. Is there a way I can define root for a project? I've tried researching this but haven't found anything.

For example, in WAMP I have

-www/project1/FOLDERS FOR SITE like images, javascript, css, etc.

I am currently in the css folder and am trying to reference a image file in the images folder.

background: url('/images/background.png') repeat; 

this should reference root directory > images > background.png

How do I define the root directory?

worldofjr
  • 3,868
  • 8
  • 37
  • 49
Rafael
  • 7,605
  • 13
  • 31
  • 46

1 Answers1

1

If you are try to go from lets say this file: rootFolder/newFolder/example.html

to: rootFolder/index.html

In example.html, you can do ../index.html and that will be able to access index.html. "../" goes a folder higher.

  • right but I want to start again at the root folder. using just / but its not working in wamp (my local server) – Rafael Oct 16 '14 at 04:33
  • I dont know why "/" is not working but you're best bet would be to do "../" however many times you need to get to the root folder –  Oct 16 '14 at 04:35
  • I was mistaken. I thought it was possible to just type in / and I would go to the master root of the site. – Rafael Nov 29 '14 at 05:06