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 ?

1
  • add your full code with css Commented Jan 23, 2019 at 6:41

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

it works ! It's a very silly mistake. Thanks again bro :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.