Posted over 1 year ago
tlnt.co/p/1y6

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

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

Comments

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

Liked_post_header
15b2f7b_speck Jared_gaze_speck