How to go up a level in the src path of a URL in HTML?

aateeque picture aateeque · Jan 26, 2011 · Viewed 308.3k times · Source

I am storing style sheets in {root}/styles while images in {root}/images for a website. How do I give the path in the style sheets to go look in the images directory for the specified images?

e.g. In background-image: url('/images/bg.png');

Answer

lonesomeday picture lonesomeday · Jan 26, 2011

Use .. to indicate the parent directory:

background-image: url('../images/bg.png');