Do you have any tips on designing a mobile-friendly navigation bar?

Struggling with creating a responsive navbar using Bootstrap 5? The navbar-brand is causing issues with letters overflowing over other elements, and the toggle-icon is not aligning properly. Check out my Codepen for reference: https://codepen.io/namename123/pen/VwQzRPL

.logo-iddeea {
  font-family: 'Agency FB', sans-serif;
  font-size: 3.5rem;
  background-image: linear-gradient(to left,rgb(254, 168,100), rgb(240,104,69));
  background-size: 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -moz-background-clip: text;
  -moz-text-fill-color: transparent;
}
.logo-image{
  height:100px;
  width:100px;
}
.portal-open-data{
  font-size:1.3rem;
  margin-top:-5%;
}
.nav-link {
  color: #2c3474;
  font-weight:bold;
}
.blue-color-font {
  color: lightblue;
}
@media only screen and (max-width: 700px) {
  .logo-slika{
    width:80px;
    height: 80px;
  }
  .logo-iddeea{
    font-size:2.5rem;
  }
  .portal-otvorenih-podataka{
    font-size:0.8rem;
  }
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4a2825253e393e382b3a0a7f647a6478">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="http://fonts.cdnfonts.com/css/agency-fb" rel="stylesheet">
<nav class="navbar navbar-expand-sm  navbar-dark container-fluid bg-dark offset-0">
  <div class="container-fluid">
    <a class="navbar-brand " href="#">
    <div class="row">
      <div class="col-3"> <img src="https://shoutcart.com/uploads/gig/bd6f3a23cd5294a2370b09bc413f3331.png" alt="" class="d-inline-block logo-image"></div>
        <div class="col-9">
          <div class="row">
            <div class="col-md-5 ps-4 ps-md-1 my-md-auto logo-iddeea">
              AABBA
            </div>
            <div class="col-md-7 ps-sm-1 ps-4 blue-color-font my-md-auto portal-open-data  ">
              SOME COMPANY <div style="margin-top:-3%;"> TEXT</div>
            </div>
          </div>
        </div>
      </div>
    </a>

    <button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbarCollapse">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div id="navbarCollapse" class="collapse navbar-collapse ms-5">
      <ul class="nav navbar-nav">
        <li class="nav-item  ">
          <a class="nav-link blue-color-font">Groups</a>
        </li>
        <li class="nav-item dropdown  ">
          <a href="#" class="nav-link dropdown-toggle blue-color-font" data-bs-toggle="dropdown">Passwords</a>
        </li>
        <li class="nav-item">
          <a class="nav-link blue-color-font">Administrators</a>
        </li>
        <li class="nav-item  ">
          <a class="nav-link blue-color-font">Users</a>
        </li>
        <li class="nav-item  ">
          <a class="nav-link blue-color-font">Documentation</a>
        </li>
        <li class="nav-item  ">
          <a class="nav-link blue-color-font">Activity logs</a>
        </li>
      </ul>
      <ul class="nav navbar-nav ms-auto">
        <li class="nav-item dropdown card shadow">
          <a href="#" class="nav-link dropdown-toggle blue-color-font" data-bs-toggle="dropdown">Logged Username</a>
          <div class="dropdown-menu dropdown-menu-end orange-border">
          <a href="#" class="dropdown-item blue-color-font">Reports</a>
          <a href="#" class="dropdown-item blue-color-font">Settings</a>
          <div class="dropdown-divider blue-color-font"></div>
          <a>Logout</a>
          </div>
        </li>
      </ul>

    </div>
  </div>
</nav>

Answer №1

<nav>
  <div>
    <a><img src="https://shoutcart.com/uploads/gig/bd6f3a23cd5294a2370b09bc413f3331.png" alt="" class="logo-image"></a>
    <a href="#"><h1>AABBA</h1></a>
    <span> SOME COMPANY TEXT</span> 
    <button type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
      <span></span>
    </button>
    <div id="navbarSupportedContent">
      <ul>
        <li>
          <a href="#">Groups</a>
        </li>
         <li>
          <a href="#">Dropdown</a>
              <ul>
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><hr></li>
            <li><a href="#">Something else here</a></li>
          </ul>
        </li>
         <li>
          <a href="#">User</a>
        </li>
        <li>
          <a href="#">Administrators</a>
        </li>
         <li>
          <a href="#">Documentation</a>
        </li>
          <li>
          <a href="#">Activity logs</a>
        </li>
      </ul>
      <form role="search">
        <button type="submit">Search</button>
      </form>
    </div>
  </div>
</nav>

use this code and remove all styles which are not required

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

PNG file unable to display in Google Chrome

I created an image using paint.net and saved it as a .png file. However, when I try to display the image on my website, only the borders show up without any image content. Here is the code I used: HTML <a href="home.php"><img id="logo" src="../i ...

Tips for determining the full width of a webpage, not solely the width of the window

While we can easily determine the width of the window using $(window).width(); This only gives us the width of the window itself, not accounting for any overflowing content. When I refer to overflowing, I mean elements that extend beyond the visible view ...

Delete the CSS class from a specific HTML element

Having just started learning HTML and CSS, I encountered an issue. I applied a CSS class to a table element. Subsequently, I inserted a child table within the parent table. The problem arose when the CSS class of the parent table also influenced the child ...

Retrieving CSS style values with Node.js

I am looking to design a new CSS style that includes the lowest and highest values. table[my-type="myStyle"] { width: 255.388px !important; } This code snippet is included in numerous CSS files within my style directory. ...

Formatting won't assist in aligning Facebook button

I am currently working on a page that includes a div with a Facebook recommend button. In order to style the Facebook code, I enclosed it with this formatting: <div style="align:center"> <div id="fb-root"></div> <script src=" ...

Since updating my background-image, the header images have mysteriously vanished

Currently, I am in the process of building a webpage and want to create a default navigation bar that will be consistent across all pages. Below is the code snippet from the file where I wish to include my navigation bar: <html> <head> < ...

The Bootstrap Hugo Documentation website is experiencing difficulties and displaying the error message "failure to render 'page'"

Currently, I have bootstraps' source code downloaded on my Mac along with all the necessary node packages installed. Upon attempting to run hugo --cleanDestinationDir --printUnusedTemplates (hugo is properly installed), I encountered the following err ...

Pop-up window for uploading files

Looking for assistance with my file uploading system. I am utilizing a unique purple button from http://tympanus.net/Development/CreativeButtons/ (Scroll down to find the purple buttons). Additionally, I am using a wide, short content popup feature availa ...

The selected jquery script is failing to function as intended

I'm currently implementing jQuery chosen in a select element to enhance user experience, however I'm facing an issue when attempting to copy the chosen div to another div using jQuery $(document).ready(function() { $(".chosen").chosen({}); ...

Struggle with incorporating a file

As part of the login process, I have two options available: easy login and standard login. The easy login requires an employee ID, birthdate, and captcha answer, while the standard login asks for first name, last name, birthdate, and captcha. To facilitate ...

Desktop display issue: Fontawesome icon not appearing

Having trouble getting the fontawesome icon to display properly on my website. It appears in inspect mode, but not on the actual site itself. Any suggestions on how to fix this issue? import React, { Fragment, useState} from "react"; import { Na ...

The third @media query for max-width is not functioning as expected in the CSS

Looking to create a responsive card section on my website for various screen sizes. The goal is to display 5 cards per row when the screen width is greater than 1300px, maintain 3 cards per row from 1024px to 1300px, and then switch to only 2 cards per row ...

Issue with mix-blend-mode causing text to not show up on top of the gradient

I am struggling to find a way to make text easily readable over my gradient background. Despite trying to use MUI's Typography or a simple <p>, the contrast isn't great as the text appears in black. After some research, I discovered that I ...

What is the best way to eliminate alternative styling from a chart component in C#.NET?

I've encountered an issue with a stacked chart component on a c#.net webform from the MS Chart Control Library. Initially, I dragged the control onto the design surface and then proceeded to edit the source html (.aspx page) to assign the element a cs ...

The flashing of Bootstrap tabs can be seen on various pages

Currently, I am encountering an issue with bootstrap tabs on my website. There seems to be a blinking problem with the tabs on certain pages. Check out this video showcasing the blinking tab in the search result page: Watch Here Interestingly, the same ta ...

SASS malfunctioning, error messages popping up in command prompt while running gulp serve

As I develop a web app using AngularJS and Gulp, I encounter an issue where the CSS does not seem to work when running 'gulp serve'. Despite attempting to reinstall various components like node_modules, Node.js, and Gulp, the same error persists. ...

Create circular Styled components in React JS

Currently, I am attempting to create a component within a wrapped styled component. The Styled component has a circular shape, and I am seeking assistance in styling it accordingly. Can anyone provide guidance on how to apply the styles needed to achieve a ...

Aligning image vertically

I'm working on aligning an image vertically in my header. Currently, it's horizontally centered. header { background-color: blue; height: 118px; width: 1024px; text-align: center; } .container { margin-left: auto; margin-right: aut ...

Ways to modify the hue of an li element in the context menu upon hovering

I'm currently working on a project that involves VueJS and Bootstrap. To enhance user experience, I've incorporated a context menu using the npm package called vue-context Vue Context Menu When a user hovers over an item on the context menu, the ...

What are the ways to ensure my query columns fill the entire page space?

Currently, when I execute a query, it retrieves the correct information. However, I want to make my columns span across the entire page instead of being centered in the middle with empty space on the sides. Is there a way to expand the columns? Below is t ...