Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Linking image into CSS path goes wrong path

I am working on the project which is in subfolder "CMS2".

CSS file - css/style.css , It is actually under admin folder. Problem is not the CSS

Images folder is in root directory of the CMS2.


width: 120px;
margin:10% auto;
background: url(../images/loader.gif);
background-size: 40%;
background-repeat: no-repeat;
background-position: center;


loader.gif is still not working even I have given the correct path with TWO dots.

Wrong path - http://localhost/cms2/admin/images/loader.gif (how can i remove the admin/)

Correct Path --- http://localhost/cms2/images/loader.gif

Kindly help

1 Answer

Julian Garcia
Julian Garcia
18,380 Points


Have you tried :

background: url("../images/loader.gif");

I just added quotation marks.

Hope this help.

Yeah, before i tried with quotation marks too. Currently, I moved the gif to the root directory and it works but still on other folder, it doesn't detecting.