Creating a unique and stylish navbar with HTML and Bootstrap

I spent the entire day grappling with a seemingly minor issue to no avail.

In my course assignment code provided below, I successfully created a page with responsive design and a toggle menu. However, while the styling appears perfect on xs browser size, it all falls apart in sm, md, and lg browser sizes. I've been unable to expand the navbar light color to include the span under navbar-brand without causing everything to shift and look unattractive.

Your assistance on this matter would be greatly appreciated.

https://jsfiddle.net/9vnh6rga/

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="Viewport" content="width=device-width, initial-scale= 1">
    <title>House Of Burger - Acceuil</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/styles.css">
    <link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Ultra" rel="stylesheet">

</head>
<body>
   <header>
       <nav id="header-nav" class="navbar navbar-default">
           <div class="container">
               <div class="navbar-header">
<!-- Removed logo image link -->
                    <div class="navbar-brand">
                        <a href="index.html"><h1>House of Burger</h1></a>
                        <span>Freshly Homemade</span>
                    </div>

                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapsable-nav" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>

                <div id="collapsable-nav" class="collapse navbar-collapse">
                   <ul id="nav-list" class="nav navbar-nav navbar-right visible-xs">
                        <li>
                            <a href="couscous.html">Couscous</a>
                        </li>
                        <li>
                          <a href="doubara.html">Doubara</a>
                        </li>
                        <li>
                          <a href="zviti.html">Zviti</a>
                        </li>                     
                    </ul> <!-- ul closing -->                
                </div> <!-- #collapsable-nav -->
            </div> <!-- .container -->
        </nav> <!-- #header-nav -->
       </header>
    <script src="js/jquery-3.1.1.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/script.js"></script>
</body>    
</html>

Answer №1

To ensure the navbar has a sufficient height, you can adjust the min-height property to 110px or any value that suits your design preference. Check out this jsfiddle

.navbar {
  min-height: 110px;
}

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

Using HTML or JavaScript to generate a multitude of identical HTML elements on a webpage

I am currently designing a page that requires the presence of numerous tree illustrations with leaves, spanning across the width at the bottom of the page. I have considered two methods to achieve this. One option is to create a single set of trees and lea ...

Finding the data type based on the button clicked with javascript: A beginner's guide

I am trying to work with a PHP function that generates dynamically created divisions. Each of these divisions contains a different data type and a button. How can I extract the data type of a division when the user clicks on the submit button using JavaScr ...

What steps are involved in creating a circular shape on canvas?

I am trying to create a circular shape in the canvas using the code below. The code involves moving an object with keyboard keys, and I need help making the canvas shape into a circle without affecting the functionality of the code. I attempted to modify t ...

Issue with ASP.net drop-down menu functionality when using Google Chrome

Having some issues with a dropdown list in an ASP.net application that loads reports from a database. The dropdown works fine in Internet Explorer but not in Google Chrome. Below is an image showing the issue in IE: And here is the same issue shown in Chr ...

Is there a way to view an image before and after uploading it?

I am encountering an issue while attempting to display a preview of an image in a form. The HTML code involved is as follows: <form action="" method="post" enctype="multipart/form-data" name="personal_image" id="newHotnessForm"> <p><lab ...

How to alter the color of an inline SVG within an <img> element

Is it possible to change the color of an SVG image, icon, or logo within an inline HTML <img> tag using style="..."? Below is a snippet of my code featuring a button with a logo that I want to change the color of: <a href="#" ...

Effortlessly Transform HTML into Plain Text Using jQuery

If I wanted to create a feature on my website where users can input text into a text area and then convert it to HTML by clicking a button, how could I achieve that? I'm looking for functionality similar to what Wordpress offers, where users can enter ...

Retrieve the Vue.js JavaScript file from the designated static directory

This is my inaugural attempt at creating a web application, so I am venturing into Vue.js Javascript programming as a newcomer. I have chosen to work with the Beagle Bootstrap template. Within my Static folder, I have a file named app-charts-morris.js whi ...

Submitting data through AJAX when clicking a button

I am currently troubleshooting the behavior of my ajax code when I submit it. Most of the elements in my form have onchange="mySubmit(this.form)" or onclick="mySubmit(this.form)" to trigger the ajax submission, and this works well for input elements where ...

Challenges with locating text within the innerHtml property of a VB WebBrowser Object

Using Visual Studio 2010 with Visual Basic.NET In my project, I have created a form that utilizes a WebBrowser control to load an HTML file. Users are able to search for specific words or phrases within the document, prompting me to extract the innerHtml ...

Troubleshooting navigation bar problems: dealing with overlapping and padding challenges in

I'm exploring how to create a hover effect with a bottom border that overlaps with the parent div (navbar) bottom border. I've applied margin:0px and padding:0px to the navbar container. I'm unsure how to make the hover bottom border effec ...

Replicating the existing div content into a textarea

I wanted to create a tool for my workplace as a learning project in html, CSS and JS. It's a timer that tracks how long I spend on tasks. Currently, I have the timer resetting itself but I'm facing an issue where the paused time is not being log ...

JQuery can be used to dynamically add a class to a table row and ensure that it is saved even

How can I persist the selected row highlight in a Bootstrap table using jQuery even after reloading the page? I have the selected objectName saved in a global variable. Is there a way to leverage this to maintain the highlight upon reload? js page: $(&ap ...

Slanted background div that adjusts to the screen size

I'm struggling to create a slanted angle div that remains responsive as the screen size changes. Unfortunately, my current layout breaks completely when the screen gets bigger. If you'd like to take a look at what I've been working on so fa ...

Organize JSON array information into HTML elements

Here is an example of JSON data: {"_id":"56af2ca2eb91bd4721443037","username":"xxxxxx","userGroup":[{"groupName":"nodeJs","groupAssigned":"No","_id":"56b086ccd1bc72eb21d99c62"},{"0":{"groupName":"php","groupAssigned":"No","_id":"56b0880d13c9fc4c22a1d291"} ...

Passing multiple checkbox values with JavaScript's DOM Event

I am working on a form that contains multiple checkbox options. Users have the ability to select one or more options. Here is the HTML code: <div id="container"> <h1 id="title">RGB Color</h1> <div id=" ...

How can we empty the <select> menu when there are no matches for the filter?

Currently, I am in the process of developing a web interface that utilizes a select element. This allows users to choose from a list of options which will then impact the entire page. To enhance user experience, I have implemented a filter system to assis ...

Searching for a specific value within a list that has been fetched from a database using AngularJs can be achieved by simply clicking on the search button

Seeking assistance on a search functionality issue. I am able to filter search results from a list retrieved from the database and displayed on an HTML page, but facing difficulty in getting complete search results from the controller. When clicking the se ...

When using Three.js, adjusting the TranslateX or Y values sometimes results in unexpected rotation instead of a straightforward movement along the axis,

In my Three.js project with TrackballControls, I am working on creating a dynamic 3D scene. One of the key components is the PerspectiveCamera that I have initialized: camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 10 ...

Steps for Implementing a "Load More" Button on an HTML JSON Page

I'm currently engaged in a project that involves fetching product information from a JSON file and displaying it on an HTML page using JavaScript. While I've successfully implemented the fetch function, I now want to add a "Load More" function/bu ...