Troubleshooting the Delay in Clearing a Bootstrap 4 Navbar

For the development of this site, I am utilizing bootstrap 4 alpha 4. You can visit the site at

To keep the logo on the line above, I have added a clear:both to the navbar.

However, there seems to be a slight delay in the items falling down properly when opening the navbar, and I'm unsure how to resolve this issue.

This is the HTML structure:

<header class="site-header">
    <nav class="navbar navbar-light bg-faded navbar-fixed-top">
        <div class="container">    
            <button type="button" 
                class="navbar-toggler hidden-md-up pull-xs-right" 
                data-toggle="collapse" 
                data-target="#nav-content"
                aria-expanded="false">
                &#9776;
            </button>
            <a href="https://www.shivampaw.com" title="Shivam Paw">
                <img alt="Shivam Paw Logo" 
                     class="navbar-brand" 
                     src="https://www.shivampaw.com/images/sp.png">
            </a>

            <div class="collapse navbar-toggleable-sm" id="nav-content">
                <ul class="nav navbar-nav pull-md-right">
                    <li class="active nav-item">
                        <a href="index.html" 
                           title="Shivam Paw Home" 
                           class="nav-link">
                            Home
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="about.html" 
                           title="About Shivam Paw" 
                           class="nav-link">
                            About Me
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="work.html" 
                           title="Shivam Paw's Work" 
                           class="nav-link">
                            My Work
                        </a>
                   </li>
                   <li class="nav-item">
                       <a href="blog.html" 
                          title="Shivam Paw's Blog"  
                          class="nav-link">
                           My Blog
                       </a>
                    </li>
                    <li class="nav-item">
                        <a href="contact.html" 
                           title="Contact Shivam Paw" 
                           class="nav-link">
                            Contact Me
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
</header>

And here is the corresponding CSS styling:

/* Navbar Changes */
.navbar-brand {
    max-width: 55px;
}

.navbar-light {
    background-color: white;
    border: none;
    -webkit-box-shadow: 0px 5px 11px 0px rgba(50, 50, 50, 0.08);
    box-shadow: 0px 5px 11px 0px rgba(50, 50, 50, 0.08);
}

.navbar-light .navbar-nav .nav-item .nav-link {
    text-transform: uppercase;
    font-size: 14px;
    font-weight: bold;
    color: black;
}

li.active.nav-item a.nav-link, 
li.active.nav-item a.nav-link:focus, 
li.active.nav-item a.nav-link:hover {
    color: #337ab7 !important;
    background-color: inherit;
}

@media (max-width: 767px){
    ul.navbar-nav{
        clear: both;
    }
}

Answer №1

To effectively style the navigation content, it is recommended to focus on the #nav-content element within the specified media query:

@media (max-width: 767px){
    #nav-content{
        clear: both;
    }
}

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

Saving a boolean option (Yes or No) via a radio button in a MySQL database

When it comes to storing Yes/No form radio button values in a PHP/MySQL application, I've noticed a variety of approaches. I'm curious to know which method is considered more effective and why. The scenario involves a typical Yes/No question with ...

Determine the angle needed to rotate a point in order to align it with another point in three-dimensional space

Given two vectors: V1 = { x: 3.296372727813439, y: -14.497928014719344, z: 12.004105246875968 } V2 = { x: 2.3652551657790695, y: -16.732085083053185, z: 8.945905454164146 } How can I determine the angle at which V1 needs to be rotated in order to face d ...

Issue with displaying image element over another element

I recently encountered a unique challenge with my SVG element, which acts as a container for a chessboard I developed. In certain key moments of the game, such as when a pawn is promoted and a player needs to choose a new piece, I found it necessary to hav ...

Rotating an object around another object in a 3D matrix axis using Three.js

I currently have the ability to rotate one axis. Here is the code that's working now: https://codepen.io/itzkinnu/full/erwKzY Is there a way to rotate an object on a random axis instead of just one fixed axis? Maybe something similar to this exam ...

What is the best way to calculate the days, exact hours, and exact minutes between two dates using JavaScript?

I need assistance with calculating the number of days, hours, and minutes between a start date time and an end time. For example: Start Date Time = "09-06-2017 10:30" End Date Time = "10-06-2017 11:45" I am looking for the result to be 1 day, 1 ...

The power of ReactJS and the mysterious nature of 'this'

The code below is currently functioning: fetchPost (id) { var mainObject = {}, toReturn = [], promises = []; var that = this; for(var i=id; i<10; i++) { promises.push(axios.get(`api/posts/${i}`)); } axios.all(promises).then(function(resul ...

Exploring the intricate design and information dynamics of MRAID 2

I am currently in the process of developing a new MRAID (v2) compliant SDK for Android that will enable rich media ads to be displayed within various android apps. Additionally, I plan to implement a backend platform that allows advertisers to create their ...

What's the best way to create an onclick event for a li element that includes a pseudo-element ::before

I have successfully created a Timeline using HTML and CSS elements. The visual result is as follows: My goal is to enable users to click on the second circle, triggering a color change in the line that connects the first and second circles. This color tra ...

Is there a quick way to use AJAX in Rails?

By using the remote:true attribute on a form and responding from the controller with :js, Rails is instructed to run a specific javascript file. For instance, when deleting a user, you would have the User controller with the Destroy action. Then, you woul ...

Utilizing Angular and Express for routing with the seamless integration of html5mode

I'm facing an issue with making angular and express routing work together with html5mode enabled. When I change state from '/' to my admins state, everything works fine until I refresh the page. Then I only get a json result of admins but my ...

Checking the validity of date inputs - microservice for timestamps

I'm encountering an issue while attempting to validate my date input. I've tried using moment js, but it seems there's a problem. The error message "date invalid" keeps popping up! Here is the code snippet: app.get("/api/timestamp/:date_s ...

Tips for sending multiple identical POST parameters

Currently, I'm in the process of developing a new user interface for a website that I frequently use. My approach involves utilizing Node.js along with request and cheerio to scrape data from various web pages. However, I've encountered an issue ...

Implement a select element with an onchange event that triggers an AJAX

As a newcomer to Javascript, I've been struggling to find a solution to my issue. The goal is to add an additional select option when the previous select option is changed. I attempted to implement the code below, but it's not functioning correct ...

Achieving Center Alignment for Material-UI's <Table> within a <div> using ReactJS

Currently, I am working with a Material-UI's <Table> embedded within a <div>. My goal is to center the <Table> while maintaining a fixed width. I want the table to remain centered in the browser, but if the browser window is minimize ...

What is the best way to test an externally hosted application with Testacular and AngularJS?

I have a Pyramid app running on http://localhost:6543. This app serves the AngularJS app at /. This app utilizes socket.io. The query is: Can I test this application using these tools? In my scenario.js file, I have the following: beforeEach(function( ...

Activate the last div within the identical class

When I make an ajax call to fetch more results and append them to the existing ones on the same page, I want to display a scrolling spinner while the contents are being fetched. I am adding a div at the bottom of the fetched results like this: <div cla ...

Unable to implement new ecmascript decorators within typescript version 2.4.2

Check out this example code: function enumerable(value: boolean) { return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { descriptor.enumerable = value; }; } class A { @enumerable(false) a: number = 1 b: number ...

Hiding labels in an HTML document can be achieved by using CSS

Recently, I've been working on a code that relies on a specific Javascript from Dynamic Drive. This particular script is a form dependency manager which functions by showing or hiding elements based on user selections from the forms displayed. Oddly ...

Having difficulty retrieving the information from checkboxes

I am facing an issue with fetching the values of checkboxes from a form that also contains input fields and a dropdown. Even though the values from input and dropdown are being fetched successfully, I am unable to retrieve the values of checkboxes. The ch ...

Steps for ensuring that a script is loaded after the page has fully loaded

Is there a way to make the progress bar begin its loading animation after the `onload` loader animation has completed? Check out this example of normal progress bar animations: JSFiddle Alternatively, here is an example with the `onload` loader added: JSF ...