Struggling to fix the excess white space appearing underneath my website

I am new to HTML/CSS and I'm currently working on adding a timeline to my website. However, I've encountered a strange issue with the #timeline class where there is an odd block of space below it whenever I try to adjust the height.

So far, I have explored some resources that mention how changing the height of an absolute or relative positioned object can create a gap between its current position and original placement. This has left me unsure about how to reposition my timeline elements without resorting to absolute positioning, as I want to avoid making the timeline too large. Any suggestions or advice would be greatly appreciated. Here's my code (please view in a full window - there may be compatibility issues with Safari at the moment so Chrome is recommended):

My CSS code is quite extensive, but I wanted to provide the complete webpage for better understanding. The issue occurred after styling the body and #timeline components, leading me to believe that the styling after these components could be causing the problem.

Any guidance you can offer would be highly valued.

html{
font-size: 10px;
font-family: Raleway;
width: 100%;
height: 100%;
background: linear-gradient(#FF9940, white);
font-weight: normal;

}

h1{
font-family: Raleway;
padding: 20px;
font-size: 53px;
text-shadow: 2px 2px 1px grey;
background-color: #1E2752;
text-align: center;
border: 5px solid black;
color: #FCFCFF;
margin-top: 10px;
}

li{
float: left;
padding-right: 30px;
}

li a{

display: block;
color: white;
text-decoration: none;
padding: 19px 16px;
border: 2px solid #ffffff;
right: -100px;

}

li a:hover{
color: #ffffff;
background: #FF9940;
transition: all 0.4s ease 0s;
}


ul{
transition: all 0.4s ease 0s;
list-style-type: none; 
text-decoration: none;
font-size: 12px;
text-transform: uppercase;
color: #ffffff;
background: transparent;
display: inline-block;
position: absolute;
text-align: center;
padding: 0px;
top: 28px;
left: 23px;
right: 23px;
width: 100%;
}

h2{
text-align: center;
font-size: 25px;
}

h2 p{
font-size: 18px;
}

.right-button{
  float: right;
  padding-right: 47px
  
}

.other-button{
float: right;
padding-right: 30px;
}

body{
font-family: tahoma;
font-size: 15px;
line-height: 1.75;
padding: 0;
margin: 0;


}

#timeline{
margin-left: 470px;
height: 400px;
width: 500px;
display:flex;
background-color: #031625;
}

#timeline:hover .t1-item{
max-width: 400px;
max-height: 500px;
width:23.3333%;
}

.t1-item:before, .t1-item:after{

transform: translate3d(0,0,0);
content: ' ';
position: absolute;
left: 0;
top: 0;

}
.t1-item{

transform: translate3d(0,0,0);
position: relative;
width: 25%;
height: 100vh;
min-height: 600px;
color:white;
overflow: hidden;
transition: width 0.5s ease;
}

.t1-item:after{

background: rgba(3,22,37,0.85);
opacity: 1;
transition: opacity .5s ease;
}

.t1-item:before{


background: linear-gradient(to bottom, 
rgba(0,0,0,0) 0%, rgba(0,0,0,1) 75%);

z-index: 1;
opacity: 0;
transform: translate3d(0,0,0) translateY(50%);
transition: opacity .5s ease,
transform .5s ease;

}

.t1-item:hover{

width: 30%;
}

.t1-item:hover:after{

opacity: 0;
}

.t1-item:hover:before{

opacity: 1;
transform: translate3d(0,0,0) translateY(0);
transition: opacity 1s ease, transform 1s ease
.25s;
}

.t1-item:hover .t1-content{

opacity: 1;
transform: translateY(0);
transition: all .75s ease .5s;
}

.t1-item:hover .t1-bg{

filter: grayscale(0);
}

.t1-content{

transform: translate3d(0,0,0) translateY(25px);
position: relative;
z-index: 1;
text-align: center;
margin: 0.1618em;
top: 55%;
opacity: 0%;

}

.t1-content h3{

font-family: tahoma;
text-transform: uppercase;
color: #1779cf;
font-size: 1.44rem;
font-weight: normal;
}

.t1-year{

position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
border-top: 1px solid white;
border-bottom: 1px solid white;
}

.t1-year p{

font-family: tahoma;
font-size: 1.628rem;
line-height: 0;

}

.t1-bg{

transform: translate3d(0,0,0);
position: absolute;
top: 0;
left: 0;
background-size: cover;
background-position: center center;
transition: filter .5se ease;
filter: grayscale(100%);
}
<!DOCTYPE html>
<html lang = "en" >

<head>
<meta charset = "UTF-8">
<title> Isabelle Kreienbrink </title>
<link href="styles/style.css" rel="stylesheet"> 
<link href="https://fonts.googleapis.com/css?family=Raleway&display=swap" rel="stylesheet">
</head>
<body>
<h1> Header </h1>
<ul>
<li><a href="#resume">Resume</a></li>
<li><a href="#academics">Academics</a></li>
<li><a href="#projects" >Projects</a></li>
<li class="right-button"><a href="#contacts">Contact Info</a></li>
<li class="other-button"><a href="#other">Test</a></li>
<li class="other-button"><a href="#other">Testing</a></li>
</ul>
<h2> Welcome to my website! 
<p> I hope you learn a little about me while you're here. </p>
</h2>

<section id="timeline">
<div class="t1-item">
<div class="t1-bg" style="background-image:url(https://eng-dev.stanford.edu/sites/default/files/styles/full_width_banner_tall/public/chalkboard_web.jpg?itok=xqk3ef56)">
</div>

<div class="t1-year">
<p class="f2 heading">2014</p>
</div>

<div class="t1-content">
<h3>Lorem ipsum dolor </h3>
<p>
test
</p>
</div>

</div>



<div class="t1-item">
<div class="t1-bg" style="background-image:url(001.jpeg)"></div>

<div class="t1-year">
<p class="f2 heading">2015</p>
</div>

<div class="t1-content">
<h3>Lorem ipsum dolor </h3>
<p>
test
</p>
</div>
</div>

<div class="t1-item">
<div class="t1-bg" style="background-image:url(001.jpeg)"></div>

<div class="t1-year">
<p class="f2 heading">2016</p>
</div>

<div class="t1-content">
<h3>Lorem ipsum dolor </h3>
<p>
test
</p>
</div>
</div>

<div class="t1-item">
<div class="t1-bg" style="background-image:url(001.jpeg)"></div>

<div class="t1-year">
<p class="f2 heading">2015</p>
</div>

<div class="t1-content">
<h3>Lorem ipsum dolor </h3>
<p>
test
</p>
</div>
</div>

</section>


</body>
</html>

Answer №1

If I've correctly grasped the issue you're facing, it seems that the problem lies with the .t1-item {height: 100vh;} rule and the min-height: 600px setting. These rules are causing the .t1-item to be pushed down in its default state, resulting in the empty space.

Instead of using fixed height values, one workaround could be adjusting the position of your .t1-item elements using margin-top:

.t1-item {
transform: translate3d(0,0,0);
position: relative;
width: 25%;
color: white;
overflow: hidden;
transition: width 0.5s ease;
margin-top: 20rem;
}

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

JavaScript providing inaccurate height measurement for an element

Upon loading the page, I am trying to store the height of an element. To achieve this, I have utilized the jQuery "ready" function to establish a callback: var h_top; var h_what; var h_nav; $(".people").ready(function() { h_top = $(".to ...

Can a YouTube video be triggered to play when a specific CSS style is selected?

I am searching for a method to display and play different YouTube videos based on a selected CSS style from a drop-down menu. I believe JavaScript can be utilized to detect the chosen CSS. Include the following in the html header of the page. <script ...

Using CSS files that are not properly imported into React components

Currently, I am utilizing multiple CSS files for a specific purpose. The issue I am facing is that when I apply styles to one component in a CSS file, it inadvertently affects other components as well, not just the intended one. I believe the root of this ...

The height of the multicell generated by fpdf is inconsistent

After writing the code below, everything seems to be working fine except for the multicell row heights which are not displaying correctly. I encountered this issue several times while testing it out. $x=$pdf->GetY(); $pdf->SetY($x+1); include_once( ...

Utilizing an Asterisk/Wildcard in the Name of a CSS Selector

Have you ever encountered an advanced CSS rule that utilizes an asterisk in the selector name? I am currently working with Bootstrap and have multiple divs nested within a parent div like this: <div class="example"> <div class="col-sm-1"> ...

Changing the way in which text is selected and copied from a webpage with visible white space modifications

After working on developing an HTML parser and formatter, I have implemented a new feature that allows whitespace to be rendered visible by replacing spaces with middle dot (·) characters and adding arrows for tabs and newlines. You can find the current ...

Guide on implementing two submission options in an HTML form using JavaScript

Currently, I am working on a form that includes two buttons for saving inputted data to different locations. However, I am facing an issue with the functionality of the form when it comes to submitting the data. Since only one submit function can be activa ...

Accessing content from a different HTML document

I'm currently working on a project using node.js where I need to take input from a text box in an HTML file and store it in an array. However, I'm struggling with how to achieve this. My ultimate aim is to create a chat application, and I believe ...

Choosing the middle child of an element without using the :nth pseudo-classes

As I gear up for a regional championship in web development for high school students, one of the preparation tasks involves solving challenges on the championship website. The HTML code provided is as follows: <h2>Task 6</h2> <article id=& ...

The function assigned to [variable].onclick is not being executed, despite no errors being displayed in the console

I'm new to javascript and I'm looking for help with a simple task. I want to create a code that when clicking on an image, it will open in a modal. This feature is important for viewing full-size images on my portfolio. Although there are no erro ...

The integration of a Bootstrap modal within the side bar's rendering

Struggling with a modal appearing inside my side div and can't find any solutions in the bootstrap5 documentation or online forums. https://i.stack.imgur.com/gHsBi.png I just want the modal to display centered on the page with the background fade ef ...

Horizontal Screen Sharing on iPad

Currently, I have a two-column website set up using Wordpress. However, I am facing an issue with the right side column scrolling over on iPads. While the page behaves properly on desktops, on iOS devices, the div is able to scroll over the navigation ba ...

Tips for displaying a setCustomValidity message or tooltip without needing to submit the event

Currently, I am utilizing basic form validation to ensure that the email entered is in the correct format. Once validated, the data is sent via Ajax for further processing. During this process, I also check if the email address is already in use and whethe ...

Choosing Issues

My selectpicker is displaying data outside the dropdown menu before making a selection. The data appears both inside and outside of the dropdown. Can someone please help me identify the issue and guide me on how to fix it? <select class="selectpick ...

Utilizing custom links for AJAX to showcase targeted pages: a beginner's guide

I am putting the final touches on my website and realized that it may be difficult to promote specific sections of the site because the browser address never changes. When visitors click on links, they open in a div using Ajax coding. However, if I want to ...

Title showcasing the index of a website

Help Needed: How to Remove "Index of /" Title on Google Search for Jobbulls Website Hello folks, I recently uploaded all the files for my website and when I search for my domain name on Google, it shows a page with the title "Index of /" listing out all t ...

Having trouble showing an image with jQuery after it has been uploaded

Currently, I have a URL that shows an image upon loading. However, I want to provide the option for users to replace this image using a form input. My goal is to display the uploaded image as soon as it's selected so users can evaluate it. I'm a ...

Questions about syntax: What is the correct course of action?

If there is a child inside a div with an id, such as id="mother", how should the css be written correctly? Example: 1) #mother ul li {...} or 2) .mother ul li {...} Is there a difference? The second example I came across when MOTHER had a class name, ...

Adjusting the width of the rail in Material UI's vertical Slider component in React

After attempting to adjust the width and height of the rail property on the material ui slider I obtained from their website demo, I have encountered an issue with changing the thickness. import React from "react"; import { withStyles, makeStyles } from " ...

What could be causing the shadowbox not to display in Internet Explorer?

I am currently working on fixing a shadowbox issue in Internet Explorer. The page where the shadowbox is located can be found at this link: Here is the HTML code: <div class="hero-image"> <a href="m/abc-gardening-australia-caroli ...