Is there a blank space beneath the CSS layout?

As I venture into the world of CSS/HTML coding, I am encountering a minor issue with a grid layout I designed. Despite not being visible in this snippet, there is a persistent white space appearing under the grid in the content management system (CMS) I utilize. This anomaly only arises when I integrate a specific code snippet. Please refer to the following code:

<style type="text/css>
.cardcontainer {
    height: 125vh;
    width: 100%;
    display: flex;
    justify-content: center;
}
.card {
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    position: absolute;
    display: grid;
    gap: 0 50px;
    padding: 100px;
  
}
.card .card-item {
    position: relative;
}
.card img {
    height: 250px;
    width: 300px;
    transition: 0.4s ease-in-out all;
}
.card .card-details {
    position: absolute;
    padding: 10px 5px;
    bottom: 0px;
    opacity: 0;
    transition: 0.4s ease-in-out all;
}
.card-details h1 {
    font-size: 18px;
    color: white;
    margin: 2px 0;
}
.card-details p {
    font-size: 14px;
}
.card-item:hover .card-details {
    opacity: 1;
    bottom: 10px;
}
.card-item:hover img {
    transform: scale(1.05);
}
@media(max-width:600px) {
    .card {
        grid-template-columns: 1fr;
        gap: 0 10px;
    }
</style>
<div class="cardcontainer">
<div class="card">
<div class="card-item"><img alt="" src="/content/Banana.png" style="width: 400px; height: 300px;" />
<div class="card-details">
<h1>Banana</h1>
</div>
</div>

<div class="card-item"><img alt="" src="/content/Apple.png" style="width: 400px; height: 300px;" />
<div class="card-details">
<h1>Apple</h1>
</div>
</div>

<div class="card-item"><img alt="" src="/content/Oranges.png" style="width: 400px; height: 300px;" />
<div class="card-details">
<h1>Oranges</h1>
</div>
</div>
</div>
</div>

Answer №1

The reason for this is the increased padding: 100px; in the .card class.

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

Utilizing Knockout to Render JSON List Items

Utilizing Knockout.js to dynamically update a view from JSON response has been my current focus. The structure of the JSON is as follows: var data = { "Properties": { "Engine Capacity": "1499cc", "Doors": 3, "Extras": [ "LED lights", ...

The drop-down menu selection is non-functional on mobile and iPad devices when using Bootstrap

<div class="panel panel-default"> <select> <option value="B3">B3</option> <option value="B4">B4</option> <option value="B5">B5</option> & ...

How can I style the inner HTML text of an element without altering the style of its subelements? (CSS Selector)

I created an html structure that looks like this: <p> This is some test inside the p tag <div class="some-class"> <div class="sub-div-class"> <i title="title test" data-toggle="tooltip" class="some-icon-class" data-ori ...

Is there a simple method to convert XML to HTML and then store the resulting HTML file?

Looking to utilize an XML file for creating HTML emails? I can create an XSL file to convert it to HTML, but am unsure how to save or copy the resulting HTML. Simply viewing the source of the XML file shows the original XML source, not the transformed HTML ...

Hide the popup by clicking anywhere outside of it

I need help with a code that involves a button triggering a popup, and I want the user to be able to close the popup by clicking outside of it when it's open. My goal is to assign the method "Close()" to the event listener that detects clicks outside ...

HTML5 Slideshow with Smooth Image Transitions

So, I have created an HTML5 image slideshow and it's working perfectly on my localhost. However, I am puzzled as to why there is no transition effect within the slideshow. I was expecting something like fading out the first picture and then having the ...

A regular expression for duplicating a line with modifications and mirroring it

I am looking to replicate a code snippet on each HTML page, with some modifications: For example: <title>Any text (even if includes :.,</title> Desired output: <title>Any text (even if includes :.,</title> <meta name="descrip ...

Having difficulty updating a web page while utilizing setInterval() and passing a function that utilizes document.write to display JavaScript content on the page

At the core of my issue lies a blank HTML page that incorporates a JavaScript file, with the following code in the JavaScript file: function doIt() { document.writeln("asdf"); } // Alternatively, you can use setTimeout setInterval("doIt()", 5000); Upon ...

Using JavaScript, capture and rearrange the colors of the store's section. JS

I'm facing a challenge with creating dynamically colored divs based on different sections in the background. While I can achieve this using CSS, I wonder if there's a more efficient way to handle the colors with JavaScript. In my current setup, ...

Adjusting the background width results in the container position being altered as well

Currently, I am working with two background images, each accompanied by a red box positioned absolutely inside a bootstrap container. The first red box is located on the right side and the second red box is on the left side. So far, everything is running ...

Creating a custom CSS counter-style reminiscent of the toLocaleString function

Is there a way to customize the list counter style to display commas in the thousands place, similar to number.toLocaleString()? Or perhaps even adjust based on locale to show either 1,234 or 1.234? I have checked the Predefined counter styles but did not ...

Finding the position or coordinates of a div element in Blazor

I am currently working on a popup component that needs to be movable. The default position is set to top:0;left:0;, causing the popup to appear in the top-left corner of the page. However, I want it to be centered on the page and then retrieve the Top Left ...

Angular - Ensuring correct rendering of a subcomponent with input parameter on the first update

Here is a snippet of code showcasing a list of educations and a component: <cdk-virtual-scroll-viewport itemSize="5" class="list-scroll"> <app-education-item *ngFor="let education of loadedEducations" ...

What is the process for setting up a template to save my HTML document while developing a web application using Python's Flask Framework in the PyCharm IDE?

I am currently working on a tutorial with FreeCodeCamp that involves using Python's Flask Framework to develop a web application in PyCharm. However, I have hit a roadblock at a part that mentions 'Flask searches for HTML files in a directory nam ...

Utilizing JQuery slideToggle() to Toggle Between Opening and Closing Multiple Divs

Utilizing Jquery's slideToggle() function to manage the opening and closing of my main menu has been a success. However, I am facing the challenge of making sure that when one div is opened, another one closes. Despite trying various methods, I have ...

Navigational menu utilizing hamburger icon in Bootsrap 4 framework

Currently, I am developing a website and have decided to utilize Bootstrap 4 for my project. My goal is to create a navbar layout that features a hamburger menu on the left side with additional navbar items positioned on the right. As the screen size decre ...

Mastering the Art of Scrolling to a Specific Div with jQuery Animation

I've been searching for a solution on stack overflow, but because I'm not very proficient in jquery, I haven't been successful. My question is, how can I smoothly scroll from the top of the page to a specific div? I've successfully ach ...

When rails code is placed within haml tags, it results in generating empty spaces within the HTML tags of browsers

Every time a rails variable is nil (or when using rails code (as seen in the third code example)), my html displays a string of empty characters. new.html.haml %h1.editable.editable_title_field{:contenteditable => 'true', :placeholder => ...

Upon initially visiting the site, the @font-face fails to load and requires a manual refresh or reload to appear correctly

After configuring the CSS file using the fontface generator from fontsquirrel.com and uploading the font files to the correct directory, the fonts on my website function properly. However, there is an issue where the fonts do not display the first time a u ...

Does the default input default to text format?

I have a somewhat peculiar question. I'm currently experimenting with Javascript for a plugin and came across an interesting scenario. Let's say I have an input element that is structured like this: <input type='cc' id='cc&apo ...