Struggling to remove the excess white space while working with Bootstrap 5

Trying to eliminate the white space visible in the image. Utilizing Bootstrap for my project, but still getting acquainted with it. My teacher suggested (without reviewing any code) that a container might be causing the issue. I disagree as the HTML container does not occupy the entire screen. There seems to be something off with an element, but since there's no CSS for the HTML element, could it be related to Bootstrap? Any assistance in identifying the problem would be greatly appreciated. View screenshot highlighting the HTML and the white box on the right side.

.page-break {
  background-color: rgb(211, 211, 211);
}

.hero-image {
  background-image: url("images/welcome-img.jpg");
  background-size: cover;
}

.hero-text {
  text-align: center;

  color: black;
}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link
      href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5c7cacad1d6d1d7c4d5e5908b948b96">[email protected]</a>/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
      crossorigin="anonymous"
    />
    <link rel="stylesheet" href="style.css" />
    <title>Document</title>
    <script
      src="https://kit.fontawesome.com/4db53af2d4.js"
      crossorigin="anonymous"
    ></script>
  </head>

  <body>
    <header>
      <section class="top-bar">
        <div class="row sticky-top">
          <img src="images/tux.png" alt="" class="col-2" />
          <h2 class="col-5">About Linux</h2>
          <div class="col-5 hamburger-menu">MENU</div>
        </div>
      </section>
    </header>
    <main>
      <div class="hero-image row">
        <div class="hero-text">
          <h1>FOSS</h1>
          <p>And why it's good for you</p>
        </div>
      </div>
      <!-- <section class="hero-section">
        <div class="hero-container">
          <img src="images/welcome-img.jpg" alt="" />
          <h1>FOSS</h1>
          <h3>And why it's good for you</h3>
        </div>
      </section>-->
      <section class="articles container">
        <article class="manjaro-article">
          <div class="container gx-4 mt-4">
            <div class="row">
              <img src="images/manjaro_scrn.png" alt="" />
            </div>
            <div class="row py-3">
              <img src="logos/manjaro.svg" alt="" class="col-3 pe-4" />
              <h2 class="col-9"><b>Manjaro</b></h2>
            </div>
            <div class="row">
              <p>
                Is an accessible, friendly, open-source operating system.
                Providing all the benefits of cutting-edge software combined
                with a focus on getting started quickly, automated tools to
                require less manual intervention, and help readily available
                when needed. Manjaro is suitable for both newcomers and
                experienced computer users.
              </p>
              <br />
              <br />
              <p>
                Unlike proprietary operating systems you have full control over
                your hardware without restrictions. This makes Manjaro a
                powerful Operating System ideal in home, work, and development
                environments.
              </p>
              <br />
              <br />
              <p>
                It is easily possible to run many popular Windows applications,
                using compatibility software such as Wine, PlayonLinux or Proton
                via Steam. The examples given here are far from comprehensive!
              </p>
              <br />
              <br />
              <p>
                Representing a perfect middle-ground for those who want good
                performance, full control, and cutting-edge software but also a
                degree of software stability.
              </p>
            </div>
          </div>
        </article>
        <div class="row page-break">
          <div>
            <p></p>
          </div>
        </div>
      </section>
    </main>
    <footer>
      <p></p>
    </footer>
  </body>
</html>

Answer №1

To properly structure your layout, remember to enclose all elements within a div marked with the class container. Insert

<div class="container">
before the <header> tag and close it after the </footer> tag using </div>. For more information on Bootstrap layout guidelines, please refer to this link.

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

Placing an Image in Next.js

I've been trying to position my image all the way to the right of the page using CSS properties like position: absolute and right: 0. I've also attempted setting the parent element's position to relative and the image's position to abso ...

javascript variable pointing to an unknown object

Below is the essential code snippet to consider: JS function ToggleRow(objTwistie, objRow) { if (objRow.style.display == "none") { objRow.style.display = ""; objTwistie.src = "../Images/SectionDown.gif"; } else { objRow.style.display = "n ...

The fundamental element in CSS for structuring and styling web

What distinguishes the selector patterns E * F and E F? Both selectors apply the appropriate style to element F which is a child of element E. Consider the following HTML structure: <div id= "parent"> <div id="subparent"> <div i ...

What's the best way to position an ion-label at the top of the stack

I'm having trouble creating an input label similar to the new Google style. However, when the label moves up, it gets cut in the middle as shown here. Despite trying to adjust the margin, padding, and Z-index, none of these solutions have resolved my ...

Learn how to implement a rotation effect on a pseudo-element in ReactJS with clickable functionality, specifically designed for SVG

[images for my project] [1]: https://i.sstatic.net/a6EFH.png [2]: https://i.sstatic.net/lMhNu.png Clicking on the orange arrow should trigger a 180-degree rotation. Can this be achieved using CSS or do I need to utilize JavaScript? Also, how can I dec ...

The dimensions of the HTML table do not adjust properly when new items are being appended using JavaScript

I utilized this HTML Code to generate a table: <div class="noten_tabelle"> <table id="grades_table" style="width:100%"> <tr> <th>Subject</th> <th>Oral</th&g ...

Error: No matching selector was located

Following the upgrade to bootstrap 5.x, the node version is currently set at v16.13.2. Additionally, the webpack version reads "webpack": "^4.36.0", and the sass-loader version as "sass-loader": "^9.0.0". Upon attemp ...

New to AppleScript: Encountered an unexpected identifier instead of the expected end of line

tell application "Microsoft Word" activate insert text "property eGrepx : "priceValue___11gHJ\">\\$\\d{2},\\d{3}.\\d{2}" " at end of text object of active document e ...

Transfer a file from the file:///var/mobile/Applications/ directory to an accessible location for reading in Cordova/PhoneGap

I have a unique 'whitelabel' app that customizes itself for each client by downloading image files from a configuration server. However, I am facing an issue where the images are not displayed and instead showing a "Not allowed to load local reso ...

Numerous navigable tabs all on a single page

After following a tutorial on YouTube to create scrollable tabs, I successfully implemented it using Bootstrap 5. However, I'm facing challenges in getting multiple scrollable tabs to function on a single page. Although the tabs and tab-content are fu ...

How to perfectly center an image vertically within a div using CSS

Seeking assistance to properly align images of different sizes in the center of a container div. Check out the attached image for reference, showcasing the gray background and the desired alignment of images in the middle. https://i.sstatic.net/M16V1.png ...

What is the process for extracting the time value from a jQuery timepicker?

I have been attempting to retrieve values from my time picker when a selection is made, but I am not seeing any values returned nor displayed in my HTML timepicker input field. Despite trying various methods, none have proven successful thus far. Method ...

Python script to extract data from websites containing javascript and script tags

I'm currently in the process of scraping a javascript-based webpage. After reading through some discussions, I was able to come up with the following code snippet: from bs4 import BeautifulSoup import requests website_url = requests.get('https:// ...

What is the best way to select and retrieve all span elements generated on my HTML webpage using jQuery?

For retrieving all input texts on my HTML page, I use the following code: var inputs = data.context.find(':input'); $('#result').text(JSON.stringify(inputs.serializeArray())); Once executed, I end up with a JSON string containing th ...

Is it possible to "preload" an image using JavaScript in order to utilize it as a CSS background-image?

Is it possible to pre-load images into a web page using Javascript in order to use them as CSS background images without experiencing any delay due to requests or uploads? If it is possible, how can this be achieved? ...

Modifying the appearance and behavior of an element dynamically as the page is being loaded using AngularJS

Struggling with a challenge for two days now, I have attempted to implement a panel-box using bootstrap and AngularJS. Within the confines of a controller, my code looks like this: <div id="menu2a"> <div class="panel list-group"> <div ...

The console correctly detects the value, but is unable to set the innerHTML property of null

I am currently working on a webpage that allows users to sign in and create an account. The issue I'm facing is that when I try to display the user's information, I encounter the error 'Cannot set property 'innerHTML' of null.&apos ...

AngularJS: Utilizing $http to fetch XML data instead of JSON

Looking to extract data from a website using angularjs / javascript. I am familiar with the $http object in angularjs which can make get requests. I have used it before to retrieve json, but I'm wondering if I can use it for XML (HTML) as well? (I th ...

Please indicate a width of 3 characters for the HTML input text

Is there a way to create an HTML text box that can only fit 3 characters exactly? I came across this code online: <input type="text" style="width: 10px; padding: 2px; border: 1px solid black"/> This code creates a text box with a width of 10px ...

Is there a way to directly import a client's .STL file into a three.js scene without having to load it from the

I am trying to implement a 'choose file' button that allows users to load files on the client side instead of from the server path in loader.load() on line 86. It seems like I might need to utilize the File API for this, but I'm still unsure ...