robert trudel
robert trudel

Reputation: 5779

Text to the right in the navbar are not displayed

I use boostrap 5, I try on a navbar to have a logo to the left and 2 link text to the right.

I created an example https://www.codeply.com/p/qeJmKiiNK0

Actually, the text to the right are not displayed.

Upvotes: 0

Views: 42

Answers (1)

Sercan
Sercan

Reputation: 5101

Navbars require a wrapping .navbar with .navbar-expand{-sm|-md|-lg|-xl} for responsive collapsing and color scheme classes.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Notify Telegram | Mr. Developer</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  </head>
  <body>
    <!-- Added "navbar-expand-*" styles to the item below. -->
    <nav class="navbar navbar-expand-lg navbar-expand-md navbar-expand-sm navbar-dark bg-dark">
      <div class="container-fluid">
          <a class="navbar-brand" href="#">
              <img src="https://w7.pngwing.com/pngs/397/510/png-transparent-graphic-design-logo-online-and-offline-business-design-company-text-logo.png" style="width:50px" />
          </a>
      </div>
      
      <!-- Moved the following container outside of the previous <div> element to align the <a> elements to the right. -->
      <div class="collapse navbar-collapse order-3 d-flex">
        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
          <li class="nav-item"><a class="nav-link" href="#">Link</a></li>
          <li class="nav-item"><a class="nav-link" href="#">Right</a></li>
        </ul>
      </div>
    </nav>
  </body>
</html>

References

Upvotes: 1

Related Questions