Spacing of the Bootstrap navbar on the right side

On the navigation bar header of my Bootstrap web app, I am facing an issue where there is no space on the right-hand side and the logout link is very close to the right border.

How can I adjust the spacing on the right?

Image:

https://i.sstatic.net/tYbHA.png

index.html

    <!-- Start of Navigation Menu -->
    <div class="navbar navbar-default navbar-fixed-top" role="navigation" ng-controller="listController">

        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
            </button>

            <a class="navbar-brand" rel="home" href="#/list">My Project</a>


        </div>

        <div class="collapse navbar-collapse">

            <div class="bgContainer" style="background-image: url('images/bg_header.gif');">

                <ul class="nav navbar-nav">
                    <li><a href="#/list"><i class="glyphicon glyphicon-registration-mark"></i>List</a></li>
                    <li><a href="#/two"><i class="glyphicon glyphicon-fire"></i> Two</a></li>


                    <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-leaf"></i> Calendar <b
                            class="caret"></b></a>
                        <ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
                            <li><a href="#/"><i class="glyphicon glyphicon-eye-open"></i> View Submission </a></li>
                            <li><a href="#/"><i class="glyphicon glyphicon-eye-open"></i> View Submission </a></li>
                            <li><a href="#/"><i class="glyphicon glyphicon-calendar"></i> Report  </a></li>
                            <li><a href="#/"><i class="glyphicon glyphicon-list-alt"></i> Template  - </a></li>
                            <li><a href="#/"><i class="glyphicon glyphicon-book"></i>  Calendar</a></li>
                            <li class="dropdown-submenu"><a tabindex="-1"> <i class="glyphicon glyphicon-cog"></i>Generate 
                            </a>
                                <ul class="dropdown-menu">
                                    <li><a href="#/"><i class="glyphicon glyphicon-cog"></i>   Report </a></li>
                                    <li><a href="#/"><i class="glyphicon glyphicon-cog"></i>  Draft  </a></li>
                                </ul></li>
                            <li><a href="#/"><i class="glyphicon glyphicon-eye-open"></i>  Feedback</a></li>
                        </ul></li>




                    <li><a href="dashboard"><i class="glyphicon glyphicon-blackboard"></i> Dashboard</a></li>
                </ul>


                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown"><a class="dropdown-toggle" role="button" data-toggle="dropdown"><i class="glyphicon glyphicon-user"></i>
                                {{fullName}} <span class="caret"></span></a>
                            <ul id="g-account-menu" class="dropdown-menu" role="menu">
                                <li><a href="#/underConstruction">My Profile</a></li>
                            </ul></li>
                        <li><a href="#/underConstruction"><i class="glyphicon glyphicon-lock"></i> Logout </a></li>
                        <!-- Spacer -->
                        <li>     </li>
                    </ul>
                </div>
            </div>

        </div>
    </div>
    <!-- End of Navigation Menu -->

Answer №1

The issue could potentially arise from the .navbar-right class, either due to positioning or overflow problems within the navbar container.

The default rule in Bootstrap is:

.navbar-right {
    margin-right: -15px;
}

To resolve this issue, you can override it with:

.navbar-right {
    margin-right: 0;
}

Answer №2

Hey everyone, appreciate your help.

Just made a small adjustment to the final menu item by adding some extra white space using  

<li><a href="#/underConstruction"><i class="glyphicon glyphicon-lock"></i> Logout &nbsp; &nbsp; &nbsp;</a></li>

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

Challenges with KendoUI integration

In one of my web pages, I have a combination box and a checkbox. To enhance the functionality, I decided to utilize the KendoUI library. The combo box allows users to choose between two options - 0% and 100%. If the checkbox is selected, the combo box shou ...

Emphasize a passage by clicking on a different section of text

Seeking Assistance I am currently customizing this template which incorporates the MixItUp plugin. My query pertains to highlighting the "filter tab" upon clicking on the corresponding text when hovering over each image, a task I find challenging as a new ...

Enhance your Joomla! template design by incorporating Bootstrap 4.3 elements and seamlessly blending custom styles with Bootstrap aesthetics

I'm working on incorporating a template I created using HTML and CSS into Joomla! 4. One specific component is this navbar: <nav class="navbar navbar-default navbar-expand-md navbar-light bg-light sticky-top"> <div class="container"> ...

What could be causing the error message "Failed to load resource: net::ERR_FILE_NOT_FOUND"?

I am currently working on a form utilizing bootstrap. I encountered an error where the styles are not loading when I open my HTML file from the folder. You can see the error image here. However, everything works fine when I use Live Server in Visual Studi ...

Using Selenium to verify that a textarea is empty when clicked on

I am currently utilizing Selenium with Python to write a functional test. My goal is to verify that when a user clicks on a textarea, its content is cleared. Below is the HTML code for the textarea: <textarea id="id_textarea" cols="50" rows="10" oncli ...

The datepickers in jQuery are failing to initialize every time the modal is opened

I have encountered an issue with using modals in my web application to receive user input. The problem arises when a user opens multiple modals one after another - the jQuery datepickers fail to initialize properly for the second modal onwards. It seems th ...

Leveraging information from a single controller for another

I am currently developing a website using MEAN stack. I am facing an issue with passing data from one controller to the next. My goal is to transfer a selected option value to the next page. Here is the section with the select box: <div class="plumber ...

Expanding divs in CSS for multiline versus single line text content

I am attempting to display text within a bordered div that is positioned absolutely inside another div. Option 1 using width:auto; - view fiddle: https://jsfiddle.net/c21kt6r4/ The issue here is that the box on the left side expands excessively. https:// ...

Is there a JQuery image viewer that can be identified by its id?

Is it possible to use iviewer with an image id instead of the image source? <script type="text/javascript"> var $ = jQuery; $(document).ready(function(){ var iv1 = $("#viewer").iviewer({ src: "test_image.jpg", --- ...

Progress bar arrows undergoing transformation in shape

I am currently developing an angular application where I have implemented a progress bar. The CSS code I have used is: CSS: .progressbar { height: 56px; background: lightgray; box-shadow: inset 0px -2px 5px rgba(0, 0, 0, 0.5); anim ...

Executing a script for every row in a table using Python and Selenium

As a newcomer to Python and Selenium, I have been struggling with a specific task for days now. Despite my efforts to search and experiment, I find myself completely stuck. My goal is to access sales records within a table that contains information about ...

Is there a way to conceal the scrollbar while still permitting scrolling?

I'm interested in creating a custom scrollbar, but in order to do so I need to hide the default scrollbar while still allowing scrolling functionality. I've attempted: overflow-y:hidden; but this method hides the scrollbar and prevents scrolli ...

The Node js server operates by passively listening for incoming connections rather than actively establishing them

I have been working on setting up a node.js server to send emails to a specific email address using the sendgrid API. Everything was working perfectly until I attempted to deploy the server on Heroku. After deployment, the terminal shows that the server ...

Basic code with an onclick function runs smoothly on Chrome, but encounters issues on Firefox

Struggling with a peculiar issue while trying to create a userscript using jQuery and JavaScript. The problem arises when attempting to add an onclick event to an image. Surprisingly, it works perfectly in Chrome (with TamperMonkey), but fails to respond i ...

Designing a dropdown menu in HTML that includes labels or helpful descriptive text to indicate different sections

I am interested in creating an HTML dropdown list that looks like this: Category1 Value1 Value2 Category2 Value3 Value4 Category3 Value5 Value6 and so on.. The labels Category1 to Category3 are meant to create a segmentation wi ...

Guide to resizing and shifting to the right using CSS techniques

As a backend developer with experience in nodejs, I am diving into the world of web application development. HTML5 and CSS are new territories for me, but you can check out my small web application here. Now, I am looking to incorporate animations into my ...

How to enhance the animation of the Material-UI right side persistent drawer

I am currently working on a sophisticated application that includes several drawers. Specifically, I am encountering an issue with the animations of the right side drawer. While the drawers animate correctly, the parent divs do not seem to follow suit. Eve ...

Different Ways to Make Custom Checkboxes Overlap with Labels in CSS

Hello everyone, I am currently diving into the world of CSS and HTML. My goal right now is to create a custom checkbox with a list of options. During my research, I stumbled upon an example on how to create custom checkboxes at this link. However, when imp ...

How can I disable the submit button when there is a change in the form input fields using PHP?

I am looking to disable a button that will submit my form if the fields are not changed. So, if I change a field, I would like to be able to submit the form by enabling the button, but only if at least one field is changed. <?php $listeToitures = $db- ...

Angular 2's subscribe method allows for actions to be taken in response to

There are two buttons, one of which is hidden and of type file. When the user clicks the first button, a confirmation dialog opens. Upon clicking "Ok" in the dialog, the second button should be clicked. The issue arises when all the logic in the subscribe ...