What is the best way to eliminate unexplained spacing at the bottom of a webpage using CSS?

I am struggling to create a basic webpage using Bootstrap and D3, and I can't seem to figure out how to remove the excess whitespace at the bottom. Any tips on how to resolve this issue would be greatly appreciated.

I attempted to set the min-height of both body and html to 100%, but unfortunately, it did not have the desired effect. You can view my code here: https://github.com/eelegiap/thesis-code/tree/main/search

body {
    padding-left: 3vh;
    padding-top: 3vh;
    padding-bottom: 20px;
}

#searchCol {
    padding-left: 6vh
}

form {
    width: 25%
}

#results {
    padding-right: 10vh;
}

#resultsContainer {
    max-height: 30%;
    overflow-y: auto
}
.result {
    padding-left: 4vh;
}
.poemResult {
    cursor: pointer;
    border-radius: 10px;
    padding-left: 10px;
    padding-top: 5px;
}

#poemContainer {
    max-height: 30%;
    overflow-y: auto;
}
#poemMeta {
    padding-top: 10vh;
    padding-left: 15vh;
    padding-bottom: 5vh
}
#poemTxt {
    padding-left: 15vh;
    padding-bottom: 10vh;
}

.input-group {
    max-width: 75%;
    padding-bottom: 5vh
}

/* Tooltip text */
.titleTooltip .tooltiptext {
    visibility: hidden;
    position: absolute;
    text-align: left;
    width: fit-content;
    height: fit-content;
    padding: 2px;
    padding-right: 15px;
    font: 12px sans-serif;
    background: #e5ffff;
    border: 1px solid gray;
    border-radius: 8px;
    pointer-events: none;

    z-index: 1;
}

.titleTooltip:hover .tooltiptext {
    visibility: visible;
}

.token mark {
    display: contents;
}

input,
.dropdown-toggle {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

.searchBar {
    min-height: 50px
}

#search {
    background-color: lightsteelblue;
}
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7c1e1313080f080e1d0c3c49524c524e">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css" />
<!-- MDB -->
<link rel="stylesheet" href="mdb5/css/mdb.min.css" />

<body>
  <div class="container">
    <br>
    <div class="row">
      <h2>Contemporary Russian Internet Poetry</h2>
    </div>
    <div class="row">
      <div class="col-sm-6">
        <div class="row" id="poemContainer">
          <div id="poemMeta"></div>
          <div id="poemTxt"></div>
        </div>
      </div>
      <div class="col-sm-6" id="searchCol">
        <div class="row">
          <div class="input-group">
            <div class="form-outline flex-fill searchBar">
              <input type="search" id="form1" class="form-control form-control-lg" />
              <label class="form-label" for="form1">Search by keyword(s)</label>
            </div>
            <button type="button" id='search' class="btn searchBar">
              <i class="fas fa-search"></i>
            </button>
          </div>
        </div>
        <div class="row" id="resultsContainer">
          <div id="results"></div>
        </div>
      </div>
    </div>
  </div>
</body>

<!-- MDB -->

<script type="text/javascript" src="mdb5/js/mdb.min.js"></script>
<!-- embedding JS libraries -->

<!-- d3 -->
<script src="https://d3js.org/d3.v7.min.js"></script>

<!-- own js files -->
<script src="js/main.js"></script>
<script src="js/text.js"></script>
<script src="js/searchResults.js"></script>

Answer №1

The utilization of padding-bottom: 20px; in your webpage design has resulted in the creation of additional space at the bottom of your website.

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

It is recommended to eliminate this padding for a more polished look.

Answer №2

Frankly speaking, I'm not sure what the reason behind its effectiveness is, but converting the max-height variables to pixel heights instead resolved the issue of trailing whitespace.

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

Is it possible to make a div resize to fit its container?

I have a square block measuring 100*100px. The container block it is within can be resized. I need the inner block to adjust its size dynamically so that it always fits inside the parent container without overflow and maintains its square shape. Important ...

What is the best way to showcase HTML content in columns with a horizontal scrolling feature?

I am trying to showcase a list of basic HTML elements such as divs, paragraphs, etc. within a fixed height container, arranged in columns with consistent width. I want them to be horizontally scrollable, similar to the layout displayed in this image. Thi ...

Trimmed scrollbar and border in Webkit

There seems to be some clipping on the scrollbar and border of the textarea: <!DOCTYPE html> <html> <head> <meta charset="UTF-8> <title>Scrollbar and Border Clipping Issue in Webkit</title> <style> ...

Hide only the table that is being clicked on, not all tables

Essentially, I am using document.querySelectorAll() to retrieve an array of div elements. In my function, handleClick(), each time the button is clicked, I want to hide the table associated with that specific button. This is the current situation: https:/ ...

Persistent hover state remains on buttons following a click event

In my current project, I am dealing with a form that has two distinct states: editing and visible. When the user clicks on an icon to edit the form, two buttons appear at the bottom - one for saving changes and one for canceling. Upon clicking either of th ...

The pause button will still function, even if the scrolling feature is enabled

I've successfully implemented a feature that pauses and plays the video on scroll when it reaches a certain pixel height. However, I'm facing an issue where the code automatically plays the video whenever the scroll position is more than 13500px ...

Does the downloading of images get affected when the CSS file has the disabled attribute?

Is it possible to delay the download of images on a website by setting the stylesheet to 'disabled'? For example: <link id="imagesCSS" rel="stylesheet" type="text/css" href="images.css" disabled> My idea is to enable the link later to tri ...

Using colored circles in ASP Dropdownlist ListItems (without jQuery): A step-by-step guide

Objective: To create a Dropdown list that displays a green circle if someone's Availability is True, and a red circle if someone's Availability is False. Note: The task needs to be accomplished without the use of jQuery, as it is restricted in t ...

Tips for creating a horizontal navbar using Bootstrap

Curious about how to create a horizontal navbar with Bootstrap. I'm unsure of where in my code the necessary commands should be placed. Being new to this, I could definitely use some guidance and patience https://i.sstatic.net/q9mZx.png ...

How can I adjust the Line Opacity settings in Google Charts?

Within my Google Charts project, I have successfully implemented a feature that changes the color of a line halfway through a graph based on certain conditions using a dataView. Here is the code snippet demonstrating this functionality: var dataView = new ...

Troubleshooting Problem with Centering Rows in Bootstrap

I am utilizing the most recent version of Bootstrap 3 to design a website for a friend, but I am encountering a challenge with centering elements on the page. Typically, I would use the following code: .center{ width: 90%; margin: 0 auto; } Howev ...

Can you show me how to magnify multiple images when hovering over them without altering their dimensions?

I am working on a gallery that features multiple images and I want the images to zoom in when hovered over without resizing the container. My project is built using Bootstrap 4. <div class="row"> <div class="col-12"><img ...

Issue with scrolling feature in div

I am currently facing an issue with scrolling on my website. Visit this site to see the problem. When scrolling down, it causes the "hidden" part of the site to slide up. I want to achieve a similar sliding effect, but it needs to be smooth. I have attempt ...

Troubleshooting problem with Z-Index conflict in Flash animation

I am facing an issue with two HTML divs - one containing a flash movie and the other simple text. I want to place the textual div on top of the flash movie div, but no matter how I set their positions in CSS or adjust their Z-Index values, the text keeps ...

Align three out of seven items in the navbar to the right using Bootstrap 4.1

Bootstrap 4.1 offers a great way to create a Navbar with multiple menu items, but I'm struggling to right justify three specific menu items within the Navbar. I've tried different methods, including using align-self-end, justify-content-end, and ...

Styling with CSS: How to Show an Absolutely Positioned Element in Google Chrome

I'm currently working on a CSS design that involves positioning an image within a span tag. Here's the CSS code I have: .dc-mega-icon { background-image: url(...); display: inline-block; position: absolute; top: 18px; width: ...

Issue with Chrome styling of li and a elements persists after link click

In my current project, I am facing an issue with my menu displaying differently in Firefox and Chrome. When clicking on the links in Chrome, they tend to move around, disrupting the styling of the menu. A common suggestion I found was to use display: block ...

How to target the following element with CSS that has a specified class name

Would it be possible to achieve this using CSS alone, or would I need to resort to jQuery? This is how my code currently looks: <tr>...</tr> <tr>...</tr> <tr>...</tr> <tr class="some-class">...</tr> // My g ...

Tips for effectively utilizing innerHTML in this particular scenario

For an assignment, we were tasked with creating a Madlib game where users input words into textfields to replace certain words in a hidden paragraph within the HTML using JavaScript and CSS. The paragraph embedded in the HTML page is as follows: <span ...

Variations in browser rendering of SVGs as CSS list-style-images

After creating a simple SVG of a red circle to serve as the list-style-image for my website, I discovered the concept in this Stack Overflow response: The solution worked seamlessly across all browsers except Internet Explorer. In IE, the SVG image render ...