0

My css file is available on the inner folder of css subfolder /css/coverdesign/mycss.css.

From that css I need to load background image url. Image is available on sub-folder /images/

I had used the following code.

background: url(../images/cover.jpg);

Guide me to load image by using proper url

Folder Structure:

/css/
    /coverdesign/
        - mycss.css
/images/
    - cover.jpg
2
  • So css and images are in the same folder? Commented Jan 3, 2015 at 11:02
  • @chipChocolate.py mycss.css is available in the sub-folder of css. And image is available in images folder Commented Jan 3, 2015 at 11:07

2 Answers 2

1

you need to go up 2 levels

background: url(../../images/cover.jpg);

first level to coverdesign, then css, then down into images

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

Comments

1

try absolute path

background: url(/images/cover.jpg);

or relative (go up two level)

background: url(../../images/cover.jpg);

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.