0

i have a stupid question,
I want to load background image with the background-image: url(images/background.jpg); function but css file location is css/main.css.

how to do that?

Thanks.

enter image description here

5
  • 1
    Go up your folder structure. ../images/background.png. Commented Dec 26, 2015 at 8:26
  • Thanks @RodrigoDela +1 Commented Dec 26, 2015 at 8:32
  • If your question was stupid like you said, why did you ask it in the first place? Why didn't you just search it up? I'm pretty sure there are plenty of resources that have an answer to this question. Only ask questions that have never been asked or answered on some other website including stackoverflow before. Please visit stackoverflows page on how to write a good question: stackoverflow.com/help/how-to-ask Commented Jan 10, 2016 at 22:58
  • @StigCoder04 This question can help to many people now, question is maybe stupid but useful. Commented Jan 10, 2016 at 23:00
  • 1
    @NiKoLaPrO, you have a point, but most people will go to w3schools instead of this. Commented Jan 10, 2016 at 23:02

1 Answer 1

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

../ puts you one folder back, if for some reason, you would need to go two, use ../../

Also make sure to include extension (jpg/png) of the background image.

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

Comments

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.