Create a non-responsive, one-line navbar for mobile in Bootstrap 4 that does not wrap around

I'm looking for a way to make my Bootstrap 4 navbar non-responsive with the toggler. Here is the issue I'm facing:

Current Navbar in big screen: https://i.sstatic.net/e3f3p.png

Navbar in mobile view:https://i.sstatic.net/7jMi5.png

What I want is for the navbar to stay on the right side of the Navbar brand even in mobile view, and it's okay if I need to use "overflow: hidden" for elements that overflow to the right.

How can I achieve this?

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bootstrap Bug Report</title>

    <link href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css" rel="stylesheet">
  </head>
  <body>

    <div class="home" style="padding-top:100px">
      <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <a class="navbar-brand" href="#">Navbar</a>

        <ul class="navbar-nav ml-auto" style="flex-direction: row;">
          <li class="nav-item">
            <a class="nav-link" href="#">Home</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Link</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Other</a>
          </li>
          
        </ul>
      </nav>
    </div>

    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    <script src="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/js/bootstrap.js"></script>
  </body>
</html>

Answer №1

Modify the .navbar style from flex-wrap: wrap; to nowrap.

.navbar {
    flex-wrap: nowrap;
}

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

Creating a vertical triangle pointing to the right as the border of a div element

Currently, I'm working on a mockup that includes the following elements. I am attempting to ensure that the triangular right end of the "Delay Your Payments" div matches the mockup exactly. To achieve this, I aim to use CSS without relying on sliced ...

When I include a class in a checkbox label, the CSS ceases to function properly

Apologies for my lack of understanding, but I am facing an issue with applying an attribute to a label element with class "c". It seems to work fine with other objects, like buttons, but not with labels. I cannot figure out why such a simple thing is not w ...

Expand the width of the image to fill the entire screen

I have been working on trying to insert an image into my header element. However, when I test it using Live Server, the image doesn't fully fill the width of the container. Update: The dimensions of the image are 899.875 x 600. Below is my CSS and H ...

Creating Dynamic Height for Div Based on Another Element's Height Using ReactJS and CSS

I'm attempting to set a fixed height for a div in order to enable overflow scrolling. However, I am encountering issues as I am using JavaScript within a useEffect hook to accomplish this task. The problem is inconsistent as sometimes the height is se ...

What is the importance of chaining selectors in order to utilize flexbox effectively?

Check out this code snippet: .flex-container { border: solid 1px purple; display: flex; } .flex-container div { border: solid 1px red; padding: 20px; margin: 20px; height: 100px; flex: 1 1 0%; } .flex-container ...

Creating a Click event for a button within a Bootstrap modal version 4.0

I am working on incorporating some functionality to the save and cancel buttons in my simple Modal (Bootstrap 4). <!-- Button trigger modal --> <button type="button" class="btn btn-primary" data-toggle="modal" data-ta ...

Resetting several sticky titles after displaying and hiding elements

Inspired by a popular codepen example, I have successfully implemented sticky titles in my sidebar. However, when integrating these sticky titles with the functionality to show/hide related items on click, I encountered some unexpected issues. The code sni ...

Why won't the display: block CSS style apply to my div element?

Take a look at my code: https://jsfiddle.net/r62p4209/ I created a search bar with company brand name and some buttons on the right, positioned in the center. My aim is for the search bar (from "search by:" to the "Go!" button) to move onto the next lin ...

Hover without proper anchoring / move to section on click without anchor tag

I need assistance with a jump tab feature I am implementing on my portfolio website. I have encountered a couple of issues that I could use some help with. https://i.sstatic.net/8hwgL.png <ul class="section"> <li><span>home& ...

Tips for stopping automatic scrolling (universal solution)

Issue or Inquiry I am seeking a way to disable actual scrolling on an element while still utilizing a scrollbar for convenience (avoiding the need for manual JavaScript implementations instead of relying on browser functions). If anyone has an improved s ...

How can you use ng-click to disable a div in AngularJS?

I'm looking to dynamically disable a div in AngularJS based on a certain condition. I know I can achieve this by adjusting the CSS (such as reducing contrast and color) but the div also has an ng-click property that I want to prevent from being trigge ...

Create a captivating sliding effect on Windows 8 using a combination of CSS and JavaScript

I believe that using css3 alone can achieve this effect, but I'm struggling with understanding properties like 'ease' in css3. This is the progress I have made so far: http://jsfiddle.net/kwgy9/1/ The word 'nike' should slide to ...

Overlaying a parent container DIV on top of its child elements

My JavaScript scrolling view is quite intricate, enclosed within a DIV. The elements inside have event handlers for mouseover and mouseout to manage the scrolling behavior, as well as clickable links. Currently, I am in need of a semi-transparent image th ...

What is the process for implementing a simple bootstrap design similar to the one featured in the Laravel 5 tutorial?

I recently started using Laravel. After installing Laravel 5 on my Windows 7 machine with WAMP, I began working through the intermediate task tutorial on the Laravel documentation (http://laravel.com/docs/5.1/quickstart-intermediate). The tutorial includes ...

Is there a way to position the text within an email body at the center using SendGrid?

I've been working on creating an email newsletter template using SendGrid, and I've run into a formatting issue where the content doesn't align properly in the email body. The image below shows how it's appearing incorrectly. Does anyon ...

Ways to position one div below another div

I need the #blue div positioned below the #green div The #blue div should have a margin-top: -10px; property <style> #red{ width: 400px; border: 1px solid red; } #green{ width: 100%; height: 100px; ...

Issues with Bootstrap integration in Visual Studio causing problems

I'm encountering an alignment issue when using Bootstrap in Visual Studio, specifically with Bootstrap columns. When I use a div with the class col-md-4, it automatically adds some space to the right and doesn't align properly. However, when I wr ...

Why is it necessary to click my dropdown two times to initiate opening?

I'm currently working on a website using Bootstrap 4.3.1 and I'm facing an issue with getting the dropdown menus to open properly. I have utilized the "dropdown" class within my div. <div class="dropdown" style="float: right;"> <but ...

Is AsciiEffect.js compatible with CSS3DRenderer.js in combination with three.js/WebGL?

Having trouble using the AsciiEffect.js and CSS3DRenderer.js together, wondering if it's possible without tweaking... here's the concept var W = window.innerWidth, H = window.innerHeight; renderer = new THREE.CSS3DRenderer(); effect = new THREE. ...

Attempting to resolve the Bootstrap issue, currently in search of a suitable solution

Today I made the decision to utilize bootstrap to create a menu, but unfortunately, I've encountered a strange bug or conflict involving jQuery, potentially the UI, and Bootstrap. If you'd like, you can take a look at the picture provided in the ...