1

I am trying to load image in html like this

<body>
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-4"><img class="img-fluid" src="../static/images/zep.png" /></div>
        </div>
        <div class="row justify-content-center">
            <div class="col-md-12 text-center"><h1>Coming Soon.</h1></div>
            <!-- <div class="col-md-12 text-center"><p>Subscribe to our newsletter and stay tuned</p></div> -->
        </div>
        <!-- <div class="col-md-12 text-center"><button class="btn btn-custom">Subscribe</button></div> -->
    </div>
</body>

And this is my folder structure enter image description here

So when I run it, I get

Failed to load resource: the server responded with a status of zep.png:1 404 ()

What am I doing wrong? Any help would be appreciated. Thanks

1
  • Still not loading Commented May 18, 2019 at 2:38

1 Answer 1

3

You should not include static in the img tag's src. Resources placed in src/main/resources/static will be served from the root of your application. This means that src/main/resources/static/images/zep.png will be served from /images/zep.png.

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.