1

Background image is not showing because of image path problem.

css code

background-image: url("images/menu_home_icon.png");

My actual image path is EZ_MOVERS/images/menu_home_icon.png.

But it shows EZ_MOVERS/css/images/menu_home_icon.png while I checking through Inspect Element.

I can't find from where /css comes.

Anybody help please ?

Ahtisham
  • 9,170
  • 4
  • 43
  • 57
Arafat Rahman
  • 993
  • 5
  • 19
  • 46

1 Answers1

3

Probably because the stylesheet is located in the /css folder. Remember that the paths in the file are relative to the stylesheet's path. Based on my understanding, your directory structure looks a little like this:

EZ_MOVERS
 │
 ├── css
 │    └── <stylesheet>.css 
 └── images
      └── menu_home_icon.png

So if you want to traverse a directory up and then select the /images sibling folder, use ../images/menu_home_icon.png.

Terry
  • 63,248
  • 15
  • 96
  • 118