title: Make space to get occupied when bootstrap navbar collapses
body: <p>Hello I'm trying to make my page fill the space when my navbar collapses in mobile view but it seems to leave the space empty(Instead of the images beside it filling up). The navbar also tends to push the items downwards.I initially used bootstraps grid but switched to css grid(thought this was the problem). Any suggestions will help thanks.</p>
  <p>my code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.wrapper {
    display: grid;
    grid-template-rows: 1fr;
    grid-template-columns: auto;
    grid-auto-flow: row;
  }
  
  .mens {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 1;
    grid-row-end: 3;
  }
  
  .bars {
    grid-column-start: 2;
    grid-column-end: 4;
    grid-row-start: 1;
    grid-row-end: 1;
  }
  
  .pics {
    grid-column-start: 2;
    grid-column-end: 4;
    grid-row-start: 2;
    grid-row-end: 3;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
    &lt;meta charset="UTF-8" /&gt;
    &lt;meta name="viewport" content="width=320" /&gt;
    &lt;link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
      integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous" /&gt;
  
    &lt;title&gt;gridstest&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div class="container"&gt;
  
  
      &lt;div class="wrapper"&gt;
        &lt;div class="mens border border-primary m-2"&gt;
          &lt;nav class="nav-navbar navbar-expand-lg navbar-light"&gt;
            &lt;button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
              aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&gt;
              &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
            &lt;/button&gt;
            &lt;a class="navbar-brand p-1 fw-bolder " href="#"&gt; BRAND&lt;/a&gt;
            &lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&gt;
              &lt;ul class="navbar-nav flex-column m-1"&gt;
                &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link active" aria-current="page" href="#"&gt;OPTION X&lt;/a&gt;
                &lt;/li&gt;
                &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" href="#"&gt;OPTION X&lt;/a&gt;
                &lt;/li&gt;
                &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" href="#"&gt;OPTION X/a&gt;
                &lt;/li&gt;
                &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" href="#"&gt;OPTION X&lt;/a&gt;
                &lt;/li&gt;
                &lt;li class="nav-item"&gt;
                  &lt;a class="nav-link" href="#"&gt;OPTION X&lt;/a&gt;
                &lt;/li&gt;
                &lt;/li&gt;
              &lt;/ul&gt;
            &lt;/div&gt;
          &lt;/nav&gt;
        &lt;/div&gt;
  
        &lt;div class="bars border border-secondary m-2"&gt;
          &lt;div class="d-flex p-2 bd-highlight "&gt;
            &lt;a class="navbar-link text-dark ms-auto p-2" href="#"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="20"
                height="20" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"&gt;
                &lt;path
                  d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" /&gt;
              &lt;/svg&gt;&lt;/a&gt;
            &lt;a class="navbar-link p-2 text-dark" href="#"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
                fill="currentColor" class="bi bi-bag" viewBox="0 0 16 16"&gt;
                &lt;path
                  d="M8 1a2.5 2.5 0 0 1 2.5 2.5V4h-5v-.5A2.5 2.5 0 0 1 8 1zm3.5 3v-.5a3.5 3.5 0 1 0-7 0V4H1v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4h-3.5zM2 5h12v9a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5z" /&gt;
              &lt;/svg&gt;&lt;/a&gt;
            &lt;a class="navbar-link p-2 text-dark" href="#"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
                fill="currentColor" class="bi bi-person" viewBox="0 0 16 16"&gt;
                &lt;path
                  d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z" /&gt;
              &lt;/svg&gt;&lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="pics border border-danger border-3 m-2"&gt;
          &lt;div class="row"&gt;
  
            &lt;div class="col-6 relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left "&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class="col-6 relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
          &lt;/div&gt;
  
          &lt;div class="row"&gt;
            &lt;div class="col-6 relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class="col-6  relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
          &lt;/div&gt;
  
          &lt;div class="row"&gt;
  
            &lt;div class="col-6  relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class="col-6  relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
  
          &lt;/div&gt;
  
  
          &lt;div class="row"&gt;
  
            &lt;div class="col-6  relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class="col-6  relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
  
          &lt;/div&gt;
  
          &lt;div class="row"&gt;
  
            &lt;div class="col-6  relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
            &lt;div class="col-6  relate"&gt;
              &lt;a class="ripple" href="#"&gt;&lt;img class="img-fluid shadow" src="https://via.placeholder.com/3648.jpg"&gt;
                &lt;div class="bottom-left"&gt;
                  &lt;button type="button" class="btn btn-success btn-lg"&gt;Buy now&lt;/button&gt;
                &lt;/div&gt;
              &lt;/a&gt;
            &lt;/div&gt;
  
  
  
          &lt;/div&gt;
  
  
  
  
  
        &lt;/div&gt;
  
  
  
  
  
  
  
      &lt;/div&gt;
  
  
  
  
    &lt;/div&gt;
  
    &lt;script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"
      integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"&gt;
    &lt;/script&gt;
    &lt;script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
      integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"&gt;
    &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt; </code></pre>
  </div>
  </div>
  </p>
  <p>The image:
  <a href="https://i.stack.imgur.com/Gq3Er.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gq3Er.png" alt="enter image description here" /></a></p>