Collapsed navbar push elements outside of parent container when shown (Bootstrap 5)

Viewed 45

Intro

I'm using Bootstrap 5 (bundled with webpack 5), with his grid system and the collapse function to create the home page to this site, that has 2 sidebars that collapse into a topbar.

When we get to a mobile format the navs collapse and the columns containing them stack up leaving the 3rd col with the logo at the bottom without overflowing the parent.

Look at my 100% accurate ms paint graphics to understand better

Issue

When we show the collapsed navs, the columns containing them push the 3rd col with the logo out of the row and the container-fluid containing it.

Question

How can i make the navs expanding without pushing the logo? (to clarify the logo needs to stay below the navs

ms paint 100% accurate graphics

<div class="container-fluid">
  <div class="row">
    <div class="col-lg-1 order-0 my-auto">
      <nav class="navbar navbar-expand-lg">
        <a class="navbar-brand brand d-lg-none" href="#"
          ><b>ENV</b>Productions</a
        >
        <button
          class="navbar-toggler"
          type="button"
          data-bs-toggle="collapse"
          data-bs-target="#navbarResponsive"
          aria-controls="navbarResponsive"
          aria-expanded="false"
          aria-label="Toggle navigation"
        >
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarResponsive">
          <ul
            class="navbar-nav flex-column justify-content-between text-center text-lg-start"
          >
            <li class="nav-item">
              <a class="nav-link" href="#about">ABOUT</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#services">SEVICES</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#portfolio">PORTFOLIO</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#contact">CONTACT</a>
            </li>
          </ul>
        </div>
      </nav>
    </div>

    <div class="col-lg-10 order-lg-1 order-last my-auto text-center">
      <a class="navbar-brand brand d-none d-lg-block" href="#"
        ><b>ENV</b>Productions</a
      >
      <img
        src="assets/img/BG_ENV_MONO-800px.png"
        alt=""
        class="img-fluid"
      />
    </div>

    <div class="col-lg-1 order-lg-2 my-auto">
      <nav class="navbar navbar-expand-lg">
        <div
          class="collapse navbar-collapse justify-content-end"
          id="navbarResponsive"
        >
          <ul
            class="navbar-nav flex-row flex-lg-column justify-content-around justify-content-lg-between"
          >
            <li class="nav-item text-center">
              <a
                href="https://www.instagram.com/env.productions/?hl=it"
                target="”_blank”"
                ><i class="fa fa-instagram fa-2x" aria-hidden="true"></i
              ></a>
            </li>
            <li class="nav-item text-center">
              <a
                href="https://www.youtube.com/channel/UCIloBELeZR4x8jmrhIQXQCw/featured"
                target="”_blank”"
                ><i class="fa fa-youtube-play fa-2x" aria-hidden="true"></i
              ></a>
            </li>
            <li class="nav-item text-center">
              <a
                href="https://www.facebook.com/env.productions/"
                target="”_blank”"
                ><i class="fa fa-facebook-f fa-2x" aria-hidden="true"></i
              ></a>
            </li>
            <li class="nav-item text-center">
              <a
                href="https://www.linkedin.com/company/env-productions/"
                target="”_blank”"
                ><i class="fa fa-linkedin fa-2x" aria-hidden="true"></i
              ></a>
            </li>
          </ul>
        </div>
      </nav>
    </div>
  </div>
</div>
1 Answers

I solved this by making the logo a background-image and merging the collapsible elements under the same parent with js.

There's probably a better solution though and maybe one that let you have the image at a block/inline level.

Related