PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, September 30, 2022

[FIXED] How to add 2 texts next to logo in Bootstrap Navbar

 September 30, 2022     bootstrap-4, bootstrap-5, css, html, nav     No comments   

Issue

I am starting out with Bootstrap and I am trying to achieve this kind of look with the Navbar Component

achieve this look

I tried using the Navbar Image and Text code, but the text only continues in one line. I tried adding a break but the text will go below the logo. It'll look like this

enter image description here

This is the code snippet I followed:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar bg-light">
  <div class="container-fluid">
    <a class="navbar-brand" href="#">
      <img src="    https://getbootstrap.com/docs/5.2/assets/brand/bootstrap-logo-shadow.png" alt="" width="70" height="70" class="d-inline-block align-text-top">
      Bootstrap <br> subheading
    </a>
  </div>
</nav>


Solution

Try this:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"/>

<nav>
  <div class="container-fluid">
    <div class="d-flex flex-row">
      <a class="navbar-brand navbar" href="#">
        <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTi65_HIy_en0R9pg-vjBsO3Fi2CFbJ96MtKdGIGjrlXw&s" alt="" width="100">
        <div class="d-flex flex-column p-2 pt-0 pb-0">
          <h1 class="mb-1">Title</h1>
          <p class="mb-1">Subheading</p>
        </div>
      </a>
    </div>
  </div>
</nav>



Answered By - Aniket Chauhan
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing