0

I just have a quick questions since I'm stuck with this for like 3 hours now and can't figure it out.

<!DOCTYPE html>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

<html>
    <body>
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-md-auto">
                    <h1>TOP</h1>
                </div>
            </div>
            <div class="row justify-content-center">
                <div class="col-md-auto">
                    <h1>LEFT</h1>
                </div>
                <div class="col-md-auto">
                    <h1>RIGHT TOP</h1>
                </div>
                <div class="col-md-auto">
                    <h1>RIGHT BOTTOM</h1>
                </div>
            </div>
        </div>
    </body>
</html>

It should align like this drawing

This aligns horizontally just fine, but how do I center it on the site now vertically and make the alignment like in the picture?

nontechguy
  • 751
  • 5
  • 21
  • I don't know Bootstrap but what I see is obvious. For the second row: you have 3 columns. Actually you need 2 columns and the second one should have 2 rows. – Azu Dec 04 '21 at 19:07

1 Answers1

0

Is this what you are trying to do?

<link
  href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
  rel="stylesheet"
  integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
  crossorigin="anonymous"
/>
<script
  src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
  integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
  crossorigin="anonymous"
></script>
<style>
  .container,
  .row,
  .col {
    border-style: solid;
  }

</style>
<html>
  <body>
    <div class="container">
      <div class="row justify-content-center">
        <div class="col-md-auto">
          <h1>TOP</h1>
        </div>
      </div>
      <div class="row">
        <div class="col">
          <h1>Empty</h1>
        </div>
        <div class="col">
          <div class="row">
            <h1>RIGHT Top</h1>
          </div>
          <div class="row">
            <h1>RIGHT Bottom</h1>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
Alex
  • 146
  • 9