skip to Main Content

code
Can anyone help? Background-image doesn’t appear on the page,

althouth address seem to be correct, two levels up in the folder. but still doesn’t appear.

2

Answers


  1. Try this way:

    <div class="back-img">
    </div>
    

    Css:

    .back-img {
      height: 300px;
      background-image: url(https://img-host.wemotion.co.jp/uploads/tMXOFn.png);
      background-repeat: no-repeat;
    }
    
    Login or Signup to reply.
  2. If your SASS output and referenced stylesheet is /assets/sass/app.css your relative links will be relative to that, so it should be url("../images/title-image.jpg") as the "sass" folder is on the same level as the "images" folder.

    Reference: Using relative URL in CSS file, what location is it relative to?

    Also the parentheses are missing. Reference: https://www.w3schools.com/css/css_background_image.asp

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search