CSS tricks to create wider navigation bar

I am working on customizing my footer with a navigation bar that I want to serve as both a top navbar and a sidebar at the bottom. I would like to make them wider. How can I achieve this?

<footer class="footer">

<div class="container" id="maincontainer">
    <nav class="navbar navbar-expand-lg bg-success navbar-dark">
        <a class="navbar-brand">
            <i class="fas fa-car-crash"></i>
        </a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="collapsibleNavbar">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" asp-controller="home" asp-action="index">| Registered Brokers |</a>
                    </li>
                </ul>
            </div>
    </nav>
</div>

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

Answer №1

The width of the container is determined by using Bootstrap's .container class. If you want to change this behavior based on different viewports, you can use .container-xl or a similar class. Here's a helpful table from the link provided above:

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

To set a maximum width for large devices (> 1200px) by adding a custom class like .custom-container, you need to override the max-width property as shown below:

<div class="container custom-container" id="maincontainer">
    <nav class="navbar navbar-expand-lg bg-success navbar-dark">
        <a class="navbar-brand">
            <i class="fas fa-car-crash"></i>
        </a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="collapsibleNavbar">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" asp-controller="home" asp-action="index">| Registered Brokers |</a>
                    </li>
                </ul>
            </div>
    </nav>
</div>
@media(min-width:1200px) {
    .custom-container {
        max-width: 1200px !important; // Your custom value
    }
}

If you want the container to always take up 100% of the window width, you can replace .container with .container-fluid.

Answer №2

.full-width-container {
max-width: 90% !important;

}

I found this solution very usefulhttps://i.sstatic.net/AMRyu.png Credit to @shahryar-mohajer

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

SCSS: Error - Trying to use a media breakpoint down mixin that is not defined, even though I have imported Bootstrap

When attempting to utilize @include media-breakpoint-up in Angular, I encountered an error during compilation. Bootstrap 5.1.13 Angular CLI: 10.2.4 Node: 14.17.2 OS: win32 x64 Angular: 10.2.5 ERROR in Module build failed (from ./node_modules/sass-load ...

Guide on resizing a background image to fit a div

Looking to enhance the appearance of my website by incorporating a cover image. Positioned at the top of the page is a div tag with dimensions set to 80% width and auto height. I aim to insert an image as the background of this div, stretching in width b ...

Steps to modify the background color of an IconButton upon clicking in Material UI

After clicking on the IconButton, the background color changes to an oval shape. I now need to modify the background color when it is clicked. CSS The CSS code for the IconButton changes the background color upon hover. I require a similar effect for the ...

Animation of underline on hover for NavLink

As a newcomer to React, I am currently exploring how to create an animated underline effect when hovering over a NavLink from reactstrap. I have managed to get the underline working on hover thanks to the solution provided at , but I am struggling with imp ...

jQuery toggle causing page layout glitches

I am working with a movie title table where each cell contains a hidden div with a summary of the movie. I have successfully implemented a toggle button to show and hide the summaries, but there is an issue with the page position jumping whenever the butto ...

When clicking, populate the content of another div in a vertical top-to-bottom fashion

I am in the process of creating a functionality where clicking on one element will fill another element's content from bottom to top. Although I have managed to make it work on hover, the same functionality is not triggered when clicking on the eleme ...

Looping through PHP code to encapsulate HTML elements

As a newcomer to PHP, I appreciate your patience as I navigate this new language. My goal is to wrap a div around elements like the "h4" tag without disrupting the for loop. Is this achievable? Thank you. <?php $con=mysqli_connect("localhost","root"," ...

Altering the color scheme of all periods across the website

I have an unusual request - we want to make all the full stops on the site green in color. We've been trying to wrap each full stop in a span element, but haven't had much success so far. Is this the best approach? Here's what we have attemp ...

Certain content appears oversized on Android devices, yet appears appropriately sized on desktop computers

I am experiencing an issue with a webpage where the text appears normal on desktop but is too big on Android devices. Below is the code snippet causing the problem: <!DOCTYPE html> <html> <head> <title>ra ...

Switching Iframe Source with Javascript Button State

I'm currently working on creating a set of toggle buttons for a website that will change the content of an iframe depending on the combination of buttons selected. Let's say I want to display a product that is available in: - Three colors: Red, ...

Attempting to enhance my show/hide DIV code to efficiently target multiple divs

Currently, I am faced with a challenge involving a lengthy case study that includes numerous images. The loading time for the page is exceptionally long due to the high number of images. To address this issue, I have implemented a method using show and hid ...

Troubleshooting Angularjs: Why isn't the HTML displaying the variable value?

Trying to display the value of an AngularJS variable in HTML using this code: <div ng-controller="MyTextbox"> <p>Last update date: {{nodeID1}} </p> Here's my angularjs controller code: angular.module("umbraco").controller("MyTex ...

Unable to set margin-right on a relatively positioned element

In my Vue project, I am creating a dynamic card display that scrolls horizontally on mobile screens. This section functions as a testimonial carousel where users can swipe left or right to view different testimonials. While I have successfully applied a l ...

Tips for keeping the DropDown Menu displayed even after moving the cursor away from the targeted element in Material-UI

import React from 'react'; import { makeStyles, Typography, Grid } from '@material-ui/core'; const styles = makeStyles((theme) => ({ root: {}, textStyle: { fontFamily: 'brandon-grotesque-black', tex ...

Tips for styling Pandas dataframe using IPython HTML display

Is there a way to customize the display of pandas dataframes in IPython html format? I want to achieve the following: Have numbers right justified Add commas as thousands separators for numbers Show large floats without decimal places I am aware that nu ...

Is it possible to make an image gradually appear and disappear?

Is there a way to create a continuous fade in and out effect for an image, transitioning between 40% and 100% opacity? I attempted using a CSS3 opacity property, but it only allows for 0% and 100%, causing the fade effect to be ineffective. Does anyone h ...

Alter the design when the height of a div is adjusted

On my webpage, I have multiple divs displayed in a masonry layout. The masonry effect works smoothly, but I am facing an issue with the divs expanding in height when users leave comments. The masonry layout does not automatically adjust to accommodate the ...

Deciphering deeply nested arrays in AngularJS

Within my code, there exists a nested object that I am working with. My goal is to extract and display every node name within the list on an HTML table. $scope.data = { "name": "A", "children": [{ "name": "A1", "children": [{ " ...

What are the best practices for implementing the CSS id selector?

As someone new to web development, I am facing an issue with my code where the CSS id selector is not functioning as expected: li { border: 3px solid red; } h3 { background: green; } #special { color: green; } <h3>Todo List</h3> < ...

HTML page filled to the brim with data tables

Wrapping up a midterm assignment for an HTML course and facing an issue on the final page. The table is overflowing to the right when the browser isn't maximized, and I'm stumped on how to solve it. Any suggestions? Unfortunately, unable to shar ...