Experimenting with bootstrap and encountering a pesky bottom scroll bar while putting the finishing touches on the website layout

After experimenting with bootstrap, I encountered a bottom scroll bar issue that seems to be related to margins. I've included my code below for reference.

For the Bootstrap CSS file, you can download it from this link:

https://getbootstrap.com/docs/5.0/getting-started/download/

<body>
    <header>
        <nav class="navbar navbar-expand-sm navbar-dark fixed-top bg-enter code hereprimary">
            <div class="container">
                <a class="navbar-brand" href="./index.html">
                    <img src="./imgs/LogoWhitePlain.png" width="35" height="30" class="d-inline-block align-top" alt="DKDESIGNS">
                </a>
                <!--Logo-->
                <div class="collapse navbar-collapse" id="navbarCollapsem">
                    <ul class="nav navbar-nav">
                        <li class="nav-item">
                            <a class="nav-link active" href="./index.html">Home</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="./services.html">Services</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="./projects.html">Projects</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="./aboutMe.html">About Me</a>
                        </li>
                    </ul>
                </div>
                <!--navigation-->
            </div>
        </nav>
        <!--nav bar-->
    </header>
    <main role="main">
        <!--main content-->
        <div class="bg-dark container-">
            <div class="row">
                <div class="col-md-2 col-sm-4">
                    <img src="imgs/LogoWhite.png" class="my-sm-4" width="175" height="150" class="d-inline-block align-top" alt="">
                    <!--Logo-->   
                </div>    
                <div class="col-md-10 col-sm-8">
                    <h4 class="display-5 pt-3 mt-sm-5">
                        <em class="text-white text-left">
                            Designs made easy!
                        </em>
                    </h4>
                </div>
            </div>
        </div>
        <div class="container my-4">
            <div class="row">
                <!--first row-->
                <div class="col-md-8 col-lg-9">
                    <h4 class="display-6 text-muted text-capitalize">Our mission</h4>
                    <p>
                        Our goal is to simplify the art of designing anything for your business, whether it be 
                        a detailed logo for your company's new look, photography for a special event or employee photos, a new 
                        website and/or design to develop for your business, or an advertisement design 
                        to attract new customers/clients. We can help make it easy and efficient, so you can 
                        focus on other important aspects of your business. Let's get started on <u>your</u> project today!
                    </p>
                </div>
                <div class="col-md-4 col-lg-3 text-center py-5 bg-primary border border-dark border-3">
                    &nbsp;
                    <h4 class="text-white">Get your FREE Quote!</h4>
                    <a href="./quoteMe.html"><button class="btn btn-dark">Here</button></a>
                </div>

            </div>
        </div>
    </main>
    <footer>
        <!--footer content-->
        <div class="text-center">
            <small class="text-muted text-center">&copy;&nbsp;Daniel Krysty 2021</small>
        </div>
        <div class="row text-center">
            <div class="col-1 offset-2">
                <small>
                    <a class="text-decoration-none text-muted"href="./index.html">Home</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./services.html">Services</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./projects.html">Projects</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./aboutMe.html">About</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./contact.html">Contact</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./websites.html">Websites</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./designs.html">Designs</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./photography.html">Photography</a>
                </small>
            </div>
        </div>
    </footer>
</body>

CSS changes provided below to override bootstrap.css for version 5.0.2:

 body {
    padding-top: 3rem;
    padding-bottom: 3rem;
    width: 100%;
}

.bg-primary {
    background-color: rgb(9, 129, 109) !important;
}

.btn-primary {
    background-color: rgb(9, 129, 109) !important;
    border-color: black !important;
}

.text-primary {
    color: rgb(9, 129, 109) !important;

}

.border-primary {
    border-color: rgb(9, 129, 109) !important;

}

.jumbotron-detail-skyline {
    background: url('../imgs/skykine_BW_new2.jpg') no-repeat fixed;
}

.jumbotron {
    height: 30vh;
    background-size: cover;
    background: black;
    width: 100%;
}
main {
    margin: auto;
}

Answer №1

In this section, you have a hyphen - following the container class:

<main role="main">
    <!--main content-->
    <div class="bg-dark container-">

Please remove the hyphen - and try again.

Answer №2

To properly align your content, utilize containers. Depending on your requirements, you will need to employ either .container or .container-fluid for each section.

Feel free to experiment with the following code:

<body>
    <header>
        <nav class="navbar navbar-expand-sm navbar-dark fixed-top bg-enter code hereprimary">
            <div class="container">
                <a class="navbar-brand" href="./index.html">
                    <img src="./imgs/LogoWhitePlain.png" width="35" height="30" class="d-inline-block align-top" alt="DKDESIGNS">
                </a>
                <!--Logo-->
                <div class="collapse navbar-collapse" id="navbarCollapsem">
                    <ul class="nav navbar-nav">
                        <li class="nav-item">
                            <a class="nav-link active" href="./index.html">Home</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="./services.html">Services</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="./projects.html">Projects</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="./aboutMe.html">About Me</a>
                        </li>
                    </ul>
                </div>
                <!--navigation-->
            </div>
        </nav>
        <!--nav bar-->
    </header>
    <main role="main">
        <!--main content-->
        <div class="container-fluid bg-dark">
            <div class="row">
                <div class="col-md-2 col-sm-4">
                    <img src="imgs/LogoWhite.png" class="my-sm-4" width="175" height="150" class="d-inline-block align-top" alt="">
                    <!--Logo-->   
                </div>    
                <div class="col-md-10 col-sm-8">
                    <h4 class="display-5 pt-3 mt-sm-5">
                        <em class="text-white text-left">
                            Designs made easy!
                        </em>
                    </h4>
                </div>
            </div>
        </div>
        <div class="container my-4">
            <div class="row">
                <!--first row-->
                <div class="col-md-8 col-lg-9">
                    <h4 class="display-6 text-muted text-capitalize">Our mission</h4>
                    <p>
                        Our goal is to simplify the art of designing anything for your business, whether it be 
                        a detailed logo for your company's new look, photography for a special event or employee photos, a new 
                        website and/or design to be developed for your business, or a design for advertisements 
                        to attract new customers/clients. We can help make it easy and efficient so that you can 
                        focus on the other important aspects of your business. Let's get started on <u>your</u> project today!
                    </p>
                </div>
                <div class="col-md-4 col-lg-3 text-center py-5 bg-primary border border-dark border-3">
                    &nbsp;
                    <h4 class="text-white">Get your FREE Quote!</h4>
                    <a href="./quoteMe.html"><button class="btn btn-dark">Here</button></a>
                </div>

            </div>
        </div>
    </main>
    <footer>
       <div class="container-fluid">
        <!--footer content-->
        <div class="text-center">
            <small class="text-muted text-center">&copy;&nbsp;Daniel Krysty 2021</small>
        </div>
        <div class="row text-center">
            <div class="col-1 offset-2">
                <small>
                    <a class="text-decoration-none text-muted"href="./index.html">Home</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./services.html">Services</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./projects.html">Projects</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./aboutMe.html">About</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./contact.html">Contact</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./websites.html">Websites</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./designs.html">Designs</a>
                </small>
            </div>
            <div class="col-1">
                <small>
                    <a class="text-decoration-none text-muted"href="./photography.html">Photography</a>
                </small>
            </div>
        </div>
      </div>
    </footer>
</body>

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

Spinning a CSS object around an axis

Trying to add a unique touch to my image rotation with CSS. While familiar with rotating around x, y, and z axis, I want to achieve a diagonal rotation this time. Wondering if there's a way to tweak the y axis for a more slanted effect on my image? ...

ms-card malfunctioning due to data issues

I'm facing difficulties in transferring the data to the template. Although I can access the data in HTML using vm.maquinas and maquina, I am unable to pass it to the TEMPLATE through ng-model. Information about ms-cards was not abundant. Module ang ...

Tips for designing a multi-level dropdown navbar

I am currently facing an issue with designing a navbar. I am aiming for Multi-Level Dropdowns, but whenever I click on More Services, it automatically closes the main dropdown menu. I have experimented with various approaches, but none of them seem to be ...

Using JavaScript to manipulate CSS Keyframes

Can I control these animations with JS/JQuery instead of CSS hover action? .button { width: 350px; height: 300px; margin: 100px auto; position: relative; border: solid 2px #cbd4d9; -webkit-border-radius: 5px; -moz-border-radius: 5px; bor ...

Guidelines for Aligning Objects

I'm struggling to align two elements in HTML. Instead of lining up next to each other, they are stacking on top of one another. What I really want is for them to be placed side by side, similar to how website navigation menus work (where you can choos ...

Using a string array item to add a line break in HTML will be ineffective

Issue Resolved with Updated Code After entering text in the edit text field to be searched on the textview, the text is highlighted in color. However, all line breaks are removed, causing all the text to appear in one sentence. This problem occurs only wh ...

Troubleshooting alignment issues with flexbox in Internet Explorer 11 and Microsoft Edge

After creating a well-designed ordered list of questions on my website using Bootstrap 4 and flexboxes, I encountered an issue with strange top padding in IE11 and Edge browsers. The list displays perfectly in Firefox and Chrome, but the formatting is off ...

What is the best way to enable click functionality on the SVG Object and smoothly scroll to anchor using jQuery?

My SVG is embedded using an object tag and includes CSS3 hover animations. However, I am facing issues when trying to hyperlink the SVG with hover animation as it interferes with clicking actions. I chose not to use the long SVG path code for better code o ...

Changing the CSS class of list items in a navigation: Tips and tricks

Looking to create a navigation menu that changes the CSS class to 'active' when selected? Take a look at the code below: <ul class="smallmenuContainer"> <li><a class="active" href="index.html#red">Home</a></li&g ...

Guide to aligning items in a row [Bootstrap 5]

Can you provide a one-line solution to resolve this issue? ...

Preserving data in input fields even after a page is refreshed

I've been struggling to keep the user-entered values in the additional input fields intact even after the web page is refreshed. If anyone has any suggestions or solutions, I would greatly appreciate your assistance. Currently, I have managed to retai ...

the side panel is positioned under the main content

Can anyone help me figure out why my sidebar is not positioning correctly next to the content on the right side? No matter what I try, it keeps going underneath the content. Here's the CSS code I'm using: body { font: 10pt Calibri, Helvetica ...

Nesting functionality in TailwindCSS is currently experiencing issues when used in conjunction with tailwindcss/nesting or postcss

PostCSS Configuration module.exports = { plugins: { "postcss-import": {}, "tailwindcss/nesting": {}, tailwindcss: {}, autoprefixer: {}, }, }; Global CSS Styles .form-control { @apply w-full px-3; & p { @ ...

What is the best way to horizontally align a fixed dialog element using the right property?

I have been experimenting with positioning HTML elements using the position: fixed; and right CSS properties, as outlined in the MDN Web Docs. However, I have noticed that this approach does not work as expected when trying to position a dialog element. Wh ...

The elements of the second flex item should also be arranged in a line next to each other

<script src="https://use.fontawesome.com/2a2c577e07.js"></script> <div class="parent-flex"> <div class="class1">Class 1</div> <div class="class2"> <img src="http://farm4.static.flickr.com/3140/3506456511_43787 ...

The top header must remain fixed at the top, while the bottom footer should stay fixed at the bottom of the page. The main div will then adjust to fill

My HTML code is structured using Bootstrap to create a grid layout. The goal is to have the NAV BAR and FOOTER contained within the left container, allowing the SIDEBAR on the right to display without overlapping. Here's an example image of what I&apo ...

Guide on integrating React.js into an HTML development webpage

I can't seem to get this code to work properly. I have saved it as an .html file on my computer, but it's not displaying anything when I try to open it in Google Chrome. <DOCTYPE! html> <html> <head> <script src= ...

Guide on creating an HTML5 rectangle for reuse using the Prototypal Pattern

I'm struggling to grasp Prototypal Inheritance through the use of the Prototypal pattern by creating a rectangle object and an instance of that rectangle. It seems like it should be straightforward, but I'm having trouble understanding why the Re ...

Showing an image from a local directory in a JSP页面

I am currently working on displaying an image through JSP. The image is stored in a local path, so I have created a servlet to retrieve the image. In the src attribute of the image tag, I am providing the servlet name and image path as parameters to the se ...

The attribute 'select' is not found within the type '{}'

I am a beginner in Angular and currently working on an ecommerce project where I need to filter products based on the query parameters present in the URL. Let's take an example URL: http://localhost:4200/?category=Fruits This URL should filter all ...