Excessive navigation bar expansion

My navigation bar is causing a horizontal scrollbar to appear. I've searched for solutions, but haven't found one that works for me. The issue seems to get worse as the screen size decreases, especially in IE 11. Can anyone provide assistance? Thank you. Here is the code snippet where I suspect the problem lies (HTML, page CSS, and parallax CSS).

<body>
<div class="wrapper">
  <header class="lighthouse">
    <nav class="main">
      <div class="menu-icon"> <i class="fa fa-bars fa-2x"></i> </div>
      <div class="top-nav-logo"> <img src="images/mlc-logo/mlcwhite.png" width="97" height="59" alt="Mission Lighthouse Church Logo"/></div>
             <ul>
          <li><a href="index.html">HOME</a></li>
          <li><a href="who-jesus-is.html">WHO JESUS IS</a></li>
          <li><a href="who-we-are.html">WHO WE ARE</a></li>
          <li><a href="media.html">MEDIA</a></li>
          <li><a href="contact.html">CONNECT</a></li>
        </ul>
         </nav>
    <div class="logo"><img src="images/mlc-logo/mlc-main-320.png" width="280" height="167" alt="Mission Lighthouse Church Logo" data-enllax-ratio="-.8" data-enllax-type="foreground"/> </div>
    <div class="seagull"><img src="images/Parallax/seagull2.png" alt="Seagulls" width="276" height="136" class="seagull" data-enllax-ratio="-3" data-enllax-direction="horizontal"  data-enllax-type="foreground"/></div>
    <div class="welcome-home" data-enllax-ratio="-1.1" data-enllax-type="foreground">Welcome Home</div>
  </header>

CSS:

 html, html * {
        padding: 0;
        margin: 0;
    }
    body {
        font-size: 62.5%;
    }
    .wrapper {
        width: 100%;
        background-color: #000000;
        position: absolute;
    }
    .top-nav-logo {
        display: block;
        width: 100%;
        margin: 10px 10px 0 20px;
        position: fixed;
        z-index: 100;
    }
    .menu-icon {
        width: 50%;
        box-sizing: border-box;
        background-color: #000;
        text-align: right;
        padding: 15px 24px;
        cursor: pointer;
        color: #fff;
        display: none;
    }
    nav.main {
        display: inline-block;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        max-width: 1341px;
        margin: 0 auto;
        overflow: hidden;
        width: 100%;
        text-align: left;
        z-index: 80;
        }
    nav ul {
        list-style: none;
        text-align: center;
        background-color: rgba(0,0,0,0.0);
        overflow: hidden;
        color: #fff;
        padding: 0;
        margin: 0;
        transition: 1s;
        z-index: 80;
        }
    nav.blue ul {
        background-color: rgba(0,34,73,0.95);
        }
    nav ul li {
        display: inline-block;
        padding: 20px;
        }
    nav ul li a {
        display: inline-block;
        color: #ffffff;
        font-family: 'Montserrat', sans-serif;
        font-weight: 500;
        font-size: 1.7em;
        text-decoration: none;
    }
    nav ul li a:visited {
        color: rgba(240,183,110,1.00);

    }
    nav a:hover {
        color: #F0F694;
        text-decoration: none;
        font-weight: 700;
        transition: 1.7s;
        -webkit-transition: 1.7s; /*Safari*/
    }

CSS for Parallax:

.lighthouse {
    width: 100%;
    height: 768px;
    position: relative;
    background-image: url(../images/Parallax/front-header-4.jpg), url(../images/Parallax/2nd-header-background.jpg);
    background-size: auto 768px, cover;
    background-position: top center;
    background-attachment: fixed;
    background-repeat: no-repeat;
     will-change: transform;
    overflow: hidden;
}
.logo {
    height: 140px;
    width: 88%;
    position: relative;
    top: 170px;
    margin: 0 auto;
    text-align: center;
    opacity: 0.65;
    z-index: 20;
}
.seagull {
    height: 123px;
    width: auto;
    position: relative;
    left: -190px;
    opacity: 0.8;
    z-index: 10;
}
.welcome-home {
    font-family: 'Kaushan Script', cursive;
    font-size: 9.0em;
    color: #004391;
    position: relative;
    text-align: center;
    width: 98%;
    top: 255px;
}

Answer №1

 section.top-nav {
        display: inline-block;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        max-width: 100%;
        margin: 0 auto;
        overflow: hidden;
        width: 100%;
        text-align: center;
        z-index: 80;
        }

Implement this code in your CSS file

You added max-width:1341px; which caused it to expand excessively

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

Adjust the height of the card body to match the horizontal bootstrap 5 card image

Is there a way to use Bootstrap 5.1.3 to make the image fill the height of the card's body and footer, while also ensuring the card-footer is placed at the bottom of the card? The desired outcome: <link rel="stylesheet" href="https://cdn.jsdeli ...

Customize CSS on a specific webpage to overwrite the default values set by the

We recently had a website redesigned by a company that also manages and hosts it, along with providing our CRM system. The issue at hand is that they include a backlink in the footer that I am unable to modify since it's not part of the page until the ...

If the selected tab matches, collapse it using jQuery

When utilizing the jQuery accordion, I am looking to collapse if the currently active tab is selected. If I click on the same tab again, nothing happens. However, if I click on another tab, the activated tab changes accordingly. Check out an example on j ...

Enhance the look of your button with this jQuery styling tip

In a web page, there is a div element known as 'div1'. The desired functionality is for a button to appear on the navigation bar once 'div1' has been scrolled completely. Otherwise, the button should stay hidden. An attempt was made to ...

Dynamic Form Data Storage

I have been encountering an issue with saving email addresses entered in a form using the code provided below. Whenever I click on "Submit", it results in an internal server error. I need some assistance in resolving this problem. Code for my form.php: & ...

Exploring the Ways to Perform Mathematical Operations in HTML

I would like to display the percentage, but I am receiving values like 14.00 The expected value is 56%. 14 represents 56% of 25. Sample code: <h2>(@Model[1].filled.ToString("N2"))</h2> ...

After a PHP script is executed, a Bootstrap modal will automatically appear on the same page

Seeking assistance with integrating a bootstrap modal into a contact form submission. Despite multiple attempts, I have been unsuccessful in achieving this integration and now find myself at an impasse. My objective is simple: Upon clicking the submit bu ...

Discord between Bootstrap tabs and C3 charts: A Compatibility Str

On my website, I have implemented Bootstrap navigation tabs that each contain a chart. The issue I am facing is that when I navigate to the home page, the chart in the active tab displays perfectly fine. However, for the other tabs, the charts overlap with ...

Is there a way for me to incorporate a feature that lets the user specify the URL based on their input in a search box?

Currently, I am working on a project that involves creating two text fields for user input, along with a "View Report" button. My goal is to have the button redirect users to a specific URL structured like this: http://example.com/reports/example/reports/ ...

Image not displayed when JavaScript adds <IMG SRC=

While I am dynamically adding rows to a table, each new table item's innerHTML is set as follows: picCell.innerHTML = '<label for="checkbox-a" data-form="ui-btn-up-a" class="'+uncheckedClassString+'" ...

django div auto refresh

Whenever I submit a form, the content of console.html is supposed to change. I tried to use the code below to refresh the page, but it doesn't seem to refresh console.html: Javascript function autorefresh() { // auto refresh page after 1 sec ...

Uniform selection frame width across nested list elements

I want to ensure that the width of the selection frame for all nested ul li elements is consistent, just like in this example. When hovering over an element (making the entire line clickable), I don't want any space on the left. Currently, I am using ...

Using the html5-canvas element to drag connected lines

Here is an example of creating four points and connecting them: sample. My goal is to make it possible to drag the entire line connection when clicking on it, but when clicking on a circle, only that specific circle should be extended (already implemented ...

Creating a modern and sleek full-screen layout using Bootstrap 4's DIV Navbar component

Hi there, I'm seeking assistance with setting up layouts. As a newcomer to front-end development, I have been tasked with creating a layout similar to the one shown in the linked image: view desired layout The navigation elements (NAV) in the image ...

Retrieve Files with Angular Framework

I'm looking to implement a file download or view button using Angular without making a call to the backend. The file is static and the same for all users, so I want to avoid unnecessary server requests. Many solutions involve using the "download" att ...

Ways to Influence Nearby Element using CSS Hover Effects

Below is the HTML code snippet: <div id="flexi-overlay"> <a id="flexi-overlay-image-link-container" href="#" class="popup image-link"?> <img src="image.jpg" /> </a> <span id="flexi ...

Floating dropdown within a scrolling box

How can I ensure that the absolute positioned dropdown remains on top of the scrollable container and moves along with its relative parent when scrolling? Currently, the dropdown is displayed within the scrollable area. The desired layout is illustrated i ...

How can you selectively add a CSS class during the iteration of a VueJs object?

Using Vuetify components: <v-layout row wrap> <v-flex xs2 v-for="(month, key) in months" :key ="key"> <router-link class = "decoration" :to="month.target">{{(month.month)}}</router-link> </v-flex> The "v ...

Buttons and JavaScript: A Comprehensive Compilation

I'm facing an issue with my HTML buttons and JavaScript. When a button is clicked, an AJAX call should be triggered to display data. However, JavaScript seems unable to detect the button. Below is the HTML code: <ul> <li><input ...

Unexpected activation of Internet Explorer media queries causing display issues

Check out my CSS code below: @media all and (max-width: 500px){ .calendar_head{ height: 120px; line-height: 60px; } } .calendar_head{ width: 100%; font-weight: 700; color: #6a7783; text-align: center; line-heigh ...