0

Here is the example when no margin is added enter image description here

Here is when I add mt-5 ( same as margin-top:somevalue ) class to div where h1 and p elements are. enter image description here

As you can see, the image slides down.

Here is the code

  <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
      crossorigin="anonymous"
    />
    <script
      src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
      integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
      crossorigin="anonymous"
    ></script>
    <link rel="stylesheet" type="text/css" href="/css/stylelogin.css" />
    <style>
      .myHeading {

      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="myHeading text-center text-light mt-5">
        <h1 class=>Foodify Restaurant</h1>
        <p class="">Log in to see menu</p>
      </div>
    </div>
  </body>
</html>

0 Answers0