Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


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.