1

My project fetches the background images when i run it using brackets, however it doesn't load when i directly open it from the directory and neither when i upload it to the server

Html code

<header>
        <div class="header-logo"></div>
            <nav class="nav clearfix">
                <ul> 
                <li><a class="active" href="#">LOGIN</a></li> 
                <li><a href="#">SIGN UP</a></li> 
                <li><a href="#">PRODUCTS</a></li>
                <li><a href="#">ABOUT</a></li>
                <li><a href="#">HOME</a></li>
                </ul>
            </nav>
    </header>

css:

.header-logo

{
 width:20%;
 background-image: url('/images/logo.png');
background-repeat: no-repeat;
height:80px; 
float:left;
}

This is my directory structure :

enter image description here

user2218550
  • 147
  • 1
  • 2
  • 11
  • if the style in css file and the file in the css folder then your url should be url(../images/logo.png); – Moneer Kamal May 03 '15 at 07:33
  • possible duplicate of [CSS Images In another Folder](http://stackoverflow.com/questions/15785390/css-images-in-another-folder) – Shashank May 03 '15 at 08:02

1 Answers1

0

The best way to test such problems is just editing CSS rule in Firebug (or similar tool). You can edit path there and check in which situations it is working. You did not write anything about domain mapping - or is just simple opened local HTML page?

Chlebik
  • 646
  • 1
  • 9
  • 27
  • actually i had specified the wrong path , brackets that simply internally referenced the image as(/images/logo.png) so when i went to just open the page from the desktop locally it didnt load , after correcting the path to (../images/logo.png) everything is working fine even on the server – user2218550 May 03 '15 at 07:40