Posted about 3 years ago

I have multiple stylesheets and so I wanted to keep these files in their own folder, but then I realized I also referred to images in the images folder in the root folder.

I had to refresh my memory on how to refer to a folder outside the file's folder, because I didn't want to create two folders named images.

They key to writing an image url to refer to an outside folder is to use the two dots before the blackslash.

background-image: url("../images/name.jpg");

NOTE: Must use 2 dots not 3.

You might also like

SpriteMe - a service to make image sprites
How to Properly Design a Print CSS Stylesheet
How to Write a Programming Tutorial


Talentopoly Newsletter

A once-weekly round-up of the best programming and design posts.

Join 2050+ subscribers

We will never spam or share your email address. Easily unsubscribe

15b2f7b_speck Jared_gaze_speck