The navigation bar's icons are not displaying correctly in Bootstrap

I'm working on building a navigation bar using Bootstrap, but I'm facing an issue with the home icon not displaying correctly. It's not aligned properly and doesn't flow seamlessly with the rest of the list items. Can someone please assist me in resolving this? https://i.sstatic.net/7wuqo.jpg Problem: https://i.sstatic.net/r3XHY.png HTML:

<nav class="navbar navbar-inverse">
        <div class="container">
            <div class="row">
                <nav class="collapse navbar-collapse">
                    <ul class="nav navbar-nav">
                        <li>
                            <a href="#" class="navbar-brand text-center">
                                <span class="glyphicon glyphicon-home"></span>
                            </a>
                        </li>
                        <li class="active">
                            <a href="#">Avro keyboard<br/>
                                <small>For windows</small>
                            </a>
                        </li>
                        <li>
                            <a href="#">iAvro<br/>
                                <small>For Mac OS X</small>
                            </a>
                        </li>
                        <li>
                            <a href="#">ibus-avro<br/>
                                <small>for linux</small>
                            </a>
                        </li>
                        <li>
                            <a href="#">Bangla Fonts<br/>
                                <small>Unicode/ANSI fonts</small>
                            </a>
                        </li>                       
                        <li>
                            <a href="#">Others<br/>
                                <small>Misc goodies</small>
                            </a>
                        </li>
                        <li>
                            <a href="#">Blog<br/>
                                <small>Stay updated!</small>
                            </a>
                        </li>
                        <li>
                            <a href="#">Help and support<br/>
                                <small>Forum & Help files</small>
                            </a>
                        </li>
                        <li>
                            <a href="#">Developers<br/>
                                <small>repositories and resources</small>
                            </a>
                        </li>                   
                    </ul>
                </nav>
            </div>
        </div>
    </nav>

CSS:

li {
    border-left: 1px solid;
    border-top: 0px;
    border-right: 1px solid;
    border-bottom: 0px;
    border-style: solid;
    border-color: #545454;
}
a {
    color: #FFFFFF !important;
}
small {
    color: #C5C6C1;
    font-style: italic;
}

Answer №1

Feel free to make any adjustments to the following CSS rule:

.navbar-inverse .navbar-brand .glyphicon{
    padding: 5px 0 0 15px;
}

Your customized CSS could look something like this:
.navbar {
   border-radius: 0;
}
.navbar-inverse .navbar-header .navbar-brand {
    color: #FFFFFF;
}
.navbar-inverse .navbar-nav > li:first-child {
    border: none;
    padding-top: 10px;
}

// Add your modifications below
.navbar-inverse .navbar-nav {
    background-color: #333;
    height: 50px;
}

@media (max-width: 768px) {
    .navbar-inverse .navbar-nav {
        background-color: #FFF;
        height: 80px;
    }
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-inverse">
<!-- Your navigation bar content here -->
</nav>

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

Duplicate the LI element in a way that it is inserted after the original LI instead of at the end

I am looking for a way to clone an item immediately after clicking on it instead of cloning it at the end of the list. Currently, it always clones to the END and adds it after the last LI in the list. Here is a link to the jsFiddle I created jsfiddle test ...

Printing specific div content from an HTML page using a print button

I have a situation where I need to control the printing functionality of my HTML page. Currently, I have two div tags in my code with a single print button at the top of the page. When I click on this button, it prints the content from both divs. However ...

Assigning a class to a table row does not produce any changes

When a user clicks on a table, I am attempting to achieve two tasks using pure Javascript: Retrieve the row number (this functionality is working) Change the background color of the row Below is my current code snippet: document.querySelector('#t ...

Can you guide me on setting a background image URL for rails using javascript?

Within my Rails application, I have a collection of content paired with image buttons (each piece of content has an associated image). When a user clicks on one of these buttons, my goal is to display the corresponding image. All of my images are stored u ...

The jQuery UI Sortable functions are being triggered at lightning speed

I am currently working on a project where users can create a seating chart, add rows and tables, and move the tables between different rows. The functionality for adding rows and moving tables already exists in the code. However, I am facing an issue where ...

Currently utilizing Yii framework to customize the appearance of a DIV element by specifying the CSS properties within the View, and subsequently storing the CSS file

I am looking for a way to allow users to customize the properties of a parent div, such as color, background, and other CSS styles, directly from the WordPress theming dashboard interface. Can someone please guide me in the right direction? ...

Guide on manipulating the CSS class of an external library component within our custom component in Angular

My component includes an external library component, and I need to toggle one of the classes in the external component based on a condition in my own component. Since I cannot use ngClass for this purpose, I am hesitant to utilize document.querySelector. ...

Passing dynamically loaded parameters to a function during dropdown value selection in Angular 2

Could you please review if I am passing the parameters correctly in the li tag's click function of the updateId method? The console errors only point to that line. This is my app.component.html code: <div class='form-group' style="width ...

Prevent draggable functionality of jQuery UI on elements with a specific class

I have created a dynamic cart feature where users can drag and drop items into the cart. However, once an item is placed in the cart, it should no longer be draggable (though still visible but faded). I attempted to achieve this by using the following code ...

Error parsing XML: Missing opening tag

function fetchUserDetails() { $url = "http://steamcommunity.com/profiles/{$this->steamID64}/?xml=1"; $xmlData = simplexml_load_string($url); if(!empty($xmlData->error)) { return NULL; } $this->displayName = (string) $xmlData-&g ...

Due to the feature in VISUAL STUDIO CODE that presents folders and subfolders at the same level

While working on my Angular project, I encountered an issue with creating a subfolder within a folder. Despite trying the same process in Windows Explorer, I faced the same problem of them appearing on the same level. What could be causing this discrepan ...

Adjust the size of the image to match the dimensions of the div

Whenever I try to adjust the size of the image inside the div element, it doesn't seem to change. The div itself functions properly, but the image remains fixed in size. Is there a way to scale the image proportionally when resizing the div? div.col ...

What are the steps to recreate the layout of my image using HTML?

What's the best way to create a layout in HTML that expands to fit the entire screen? ...

I encountered a height discrepancy when attempting to style an unordered list to resemble a table

I have created a set of ul lists that appear as a 2-column table, just as I needed. However, an issue arises when the content of any list increases. The problem is that equal height is not being applied, causing the table to look broken. Here is my Fiddle ...

Issue with text decoration in Html, Css, and Bootstrap

this image shows the issue Hi there, I'm facing an issue with my project involving bootstrap. Whenever I include bootstrap in my project using a link, all "a" tags end up with text decoration. How can I fix this problem? ...

How to create a scrollable table using HTML and CSS

I created a Dashboard, but I'm having trouble making my mailPage scrollable. If you have some time to spare, could you please take a look at my website and help me with this issue? Here is my code: window.addEventListener("load", function () { ...

position the cursor at the end of the text within the text box

I am looking to move the cursor to the end of the text inside a text box that already contains text. Is there a way to achieve this using Java Script, CSS, or JQuery? <span> <input id="listInput" class="autocomplete-input singleselect-autocom ...

Struggling to align the login button accurately within the navbar

For proper alignment, the "Login" button needs to be pushed to the right of the navbar alongside other buttons. To see the issue and the code, check out this JSFiddle example: https://jsfiddle.net/sterlingmd17/tk17zjfq/1/ <nav class="navbar navbar ...

What is the best way to retrieve dynamic content from a .txt file and have it displayed on multiple HTML pages as they are loaded dynamically?

I have a file named 'm_data.txt' stored on the server that contains a continuous total of 77 (for instance). The total gets updated via a push.php page that writes to the .txt file. <!DOCTYPE html> <html> <head> <title> ...

The alignment of elements varies between Internet Explorer and Firefox on websites

Whenever my site loads on Firefox, the phrase "Locate A Math Instructor" appears directly above "Private Math Teacher": This is the layout I desire. However, when viewing the same page in Internet Explorer, "Find a Maths Tutor" shifts up and to the left ...