Search code examples
bootstrap-5spring-boot-starter

How to work with bootstrap correctly with html


I start learning Bootstrap but when i tried to use it, it doesn't work. here is my code. (html)==>

<!DOCTYPE html>
<html lang="en">
    <head>
      <meta charset="UTF-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      <link
        href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
        rel="stylesheet"
        integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9"
        crossorigin="anonymous"
      />
      <title>Bootstrap demo</title>
    </head>
    <body>
      <div class="card" style="width: 18rem">
        <img src="./flower.jpg" class="card-img-top" alt="Flower Image" />
        <div class="card-body">
          <h5 class="card-title">Card title</h5>
          <p class="card-text">
            Some quick example text to build on the card title and make up the
            bulk of the card's content.
          </p>
          <a href="#" class="btn btn-primary">Go somewhere</a>
        </div>
      </div>
    </body>
</html>

enter image description here

I tried many solutions but it did not work and searched on google and youtube.


Solution

  • You are using cdn for bootstrap here (href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"). Please make sure your internet connection is active. If connected using proxy make sure, it is not blocking connection to cdn server.