The navigation bar spills over the page content

I recently built a website using Bootstrap 3, but I'm facing an issue in responsive mode with the horizontal scroll bar on my index.html page. Strangely, this overflow-x problem is isolated to just this particular page and doesn't occur on any of the other pages within the site.

Initially, I suspected that the Contact section may be causing the overflow due to a box shadow effect, but even after removing it, the issue persisted. This led me to believe that the navbar itself might be the culprit.

Despite thorough investigation, I haven't been able to pinpoint the exact cause of this overflow issue.

Here's a screenshot: (showing the overflow on the right side)

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

Snippet of HTML code for the navbar:

<header id="main">
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapse" 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>
                <a class="navbar-brand" href="">
                    <!-- <img class="img img-responsive" src="www/images/srs-logo.jpg" alt="SRS Constructions"> -->
                    SRS Constructions
                </a>
            </div>
            <div class="collapse navbar-collapse navbar-right" id="collapse">
                <ul class="nav navbar-nav">
                    <li class="active"><a class="main" href="#main">Home <span class="sr-only">(current)</span></a>
                    </li>
                    <li class="dropdown" id="nav-about">
                        <a href="#about" class="dropdown-toggle main" role="button" aria-haspopup="true" aria-expanded="false">About
                        </a>
                        <ul class="dropdown-menu" style="left:0;right: auto">
                            <li><a href="about.html">The Founder</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="health-policy.html">HSE Policy</a></li>
                            <li><a href="quality-policy.html">Quality Policy</a></li>
                        </ul>
                    </li>
                    <li><a class="main" href="#services">Services</a></li>
                    <li><a class="main" href="#projects">Our Projects</a></li>
                    <li><a class="main" href="#whyus">Why Us</a></li>
                    <li><a class="main" href="#contact">Contact</a></li>
                </ul>
            </div>
        </div>
    </nav>
</header>

No specific CSS has been added to modify the width of the navbar.

CSS styles for the navbar:

/*Navbar styles*/

.navbar {
    box-shadow: 0 3px 3px rgba(0, 0, 0, 0.3);
}

.navbar-default .navbar-nav {
    font-size: 15px;
}

.navbar-fixed-top {
    min-height: 80px;
}

.navbar-nav > li > a {
    padding-top: 0px;
    padding-bottom: 0px;
    line-height: 80px;
}


.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
    color: #ffffff;
    text-decoration: none;
    outline: 0;
    background-color: #b4a28f;
}

@media (max-width: 767px) {
    .navbar-nav > li > a {
        line-height: 30px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .navbar-brand > img {
        width: 40%;
        position: relative;
        display: inline-block;
        height: auto;
        margin-left: 90px;
        margin-top: -80px;
    }
    #footer {
        color: #2e2e2e;
    }
}

@media (min-width: 767px) {
    #footer {
        color: #ffffff;
    }
}

.navbar-brand > img {
    width: 30%;
    position: relative;
    display: inline-block;
    height: auto;
    margin-left: 50px;
    margin-top: -15px;
}

The live site can be accessed here

If anyone could assist me in resolving this issue, I would greatly appreciate it.

Answer №1

Remember to always adhere to the guidelines when working with the grid system...

Ensure that columns with classes like .col-* are enclosed within a parent element with the class .row, and only elements with classes like .col-* should be direct children of a .row.

The issue causing the scrollbar in the projects section is the placement of .gallery directly inside .row, as .gallery is not intended to function as a column.

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

adjusting state with React hooks

I currently have two buttons labeled create signature and Create delivery in my file PageOne.tsx. When the state is set to InDelivery, both buttons are visible. My goal is to hide the Create delivery button initially. However, when a user clicks on the cr ...

Bootstrap Navbar and Flexbox items not aligned properly at the ends

Struggling to align items on Navbar? Here is my current setup: https://i.sstatic.net/Doc9A.jpg I'm trying to position the flag image next to the toggler button, only when the screen reaches 992px breakpoint. It seems like Bootstrap Stylesheet is us ...

Leveraging Material UI's Button element along with the enctype attribute

I'm working on incorporating Multer for image uploads and utilizing Material UI's button component with the onClick prop to submit the data. If I wrap the button component within a form tag, will it achieve the same result? If not, how can I spec ...

What is the best way to align an element at the bottom in order to allow it to grow vertically

I have a unique structure on one of my pages that I want to use for a tooltip style behavior. When the "container" element is clicked, the "child" element, which is initially hidden, should appear above the container. However, since the child's height ...

A guide on retrieving the present directory name and showcasing it on an HTML page with the help of Node.js

At the moment, I am able to view the path name in the index.js file and see the current directory name in the node.js console when I select the directory. Now, I am looking to have that directory name displayed in the text box on the template.html page. C ...

A guide to dynamically adding an HTML class using JavaScript

I have a login page with a text field for email and password, styled using the Bootstrap framework. I want to change the border color of the input field from grey to red when it is empty and the user clicks the login button. I tried implementing the code t ...

Tips on preventing empty values in a textbox

$(document).on("click", "label.radeem-textbox", function () { var content = $(".mytxt").text(); $(".radeem-textbox").replaceWith("<input class='radeem-textbox redeem-textbox'/>"); $(".radeem-textbox").val(content); r ...

I'm attempting to store this HTML code in local storage in order to utilize it on a new cart page, but I keep encountering an error

Here is the HTML snippet: <div class="cofefe"> <img src="photos/Shop%20-%20French%2Roast.png"> <p>Somecoffee</p> <p>15</p> <p>French ...

mobile-friendly sticky footer

Currently working on a website project utilizing Bootstrap 3 (http://www.patrickmanser.ch/fnws) and I am trying to implement a sticky footer. After adapting the code snippets from Bootstrap 3 examples according to my specifications, everything seems to fun ...

The integration of jQuery Masonry with margin-right for a seamless and

I have a row with two columns, where the first column has a right margin and the second one does not. I would like to use jQuery Masonry to eliminate any empty spaces. However, it seems that the margin right does not interact well with Masonry. Is there a ...

Switch up the Thumbnail Image based on the selected category

While testing a shopping site I created, I encountered an issue with changing the banners at the top of the page based on the category the user is viewing. This site is hosted on a server on my localhost, not using wordpress by the way. <div class=" ...

Utilizing URL parameters in PHP: A beginner's guide

Recently, I've been working on a report error form containing 4 essential fields: Job ID $jobid Part ID part_id Machine Note Users access the form by clicking on a table corresponding to their tasks and are directed to a new page with a URL contain ...

Ensuring consistent width for both tables

How can I ensure that two tables have the same width at all times, even when the Confirmer name is long and causes one table to expand while the other remains the same? Is there a way to keep both tables of equal width in any situation? You can view an exa ...

Displaying a child component as a standalone page rather than integrating it within the parent component's body

I'm currently working on implementing nested navigation in my website, but I am facing challenges with loading the child component without the need to include a router-outlet in the parent component. This setup is causing the child component's co ...

Display the hidden div element when clicked

In my code, I have two div elements as follows: <div class='staticMap'></div> <div class='geolocation-common-map'></div> Initially, the 'geolocation-common-map' div is removed using jQuery when the pa ...

The color of my Navbar remains stationary despite implementing Javascript for scroll effects

I am having trouble with the Javascript portion of my code, which I copied from a tutorial. The Navbar is not changing color when scrolled, and I'm not sure if the issue lies with the Javascript, the CSS, or if I need to add 'scrolled' to th ...

Styling the checked state of a switch in NativeScript/Angular with ngModel/FormBuilder

Let's explore the styling of a switch element within Angular: <Switch class="switch" formControlName="answer"></Switch> One approach involves targeting the switch with checked attribute, setting its background-color and text color accord ...

Guide to Setting Up Bootstrap 4 Beta Using Bower

Trying to update to the newest Bootstrap 4 Beta version via bower. Issue with this command: bower install bootstrap#v4.0.0-beta Getting the error message: no matches found: bootstrap#v4.0.0-beta Is there something incorrect in my process? This is how ...

Is there a way to use the <form> element with the specified action attribute and a <button> element of type submit to create a button that functions as a hyperlink?

Here is my approach to creating stylish buttons. <span class='button button-orange' id='sign-up'><input type='button' value='Sign up here' /></span> When adding an anchor tag (with href) around th ...

``There seems to be an issue with the alignment of items in the

I am fairly new to using css and bootstrap and I am currently working on integrating a carousel into my angular web app. I copied the code from the bootstrap site but I am facing challenges in aligning everything properly. Additionally, the image slides do ...