Even after reaching the bottom of the page, the div for overlay projects continues to scroll

*{
  margin: 0;
  padding: 0;
}

body{
  font-family: helvetica , sans-serif;
  background-color: #1E1E20;
}

.parallax-container {
  /* The image used */
  background-image: url("https://i.sstatic.net/BlF.jpg");
  animation-name: pixels;
  animation-duration: 800ms;
  animation-timing-function: steps(8,end);
  animation-delay: initial;
  animation-iteration-count: infinite;
  animation-play-state: initial;
  position: relative;
  /* Set a specific height */
  min-height: 800px; 
  /* Create the parallax scrolling effect */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@keyframes pixels {
  100% {
    background-position: 100% 0;
  }
}

.parallax img{
  z-index: 2;
  position: fixed;
  top: 0px;
  padding: auto;
}

.header_nav_container a, h3, h4{
  font-family: Helvetica,sans-serif;
  font-size: 40px;
  font-weight: bold;
  color:white;
}

.header_nav_container h1{
  font-family: Helvetica, sans-serif;
  font-size: 80px;
  text-align: center;
  color: white;
  top: 250px;
  z-index: 4;
  position: relative;
}

.header_nav_container a{
  top: 50px;
  left: 50px;
  text-decoration: none;
  position: relative;
}

.header_nav_container h3{
  top: 50px;
  right: 50px;
  position: absolute;
}

.header_nav_container h4{
  top:90px;
  right: 50px;
  position: absolute;
  font-size: 30px;
  color: yellow;
}


.header_nav_container span{
  text-shadow: 8px 8px black;
}

.projects_container h1{
  font-size: 50px;
  text-align: center;
  color: white;
  font-family: helvetica, sans-serif;
  margin-top: 20px;
}

.front p{
  padding: 10px;
  text-align: center;
  font-family: helvetica, sans-serif;
  font-size: 30px;
  color:white;
}

.underscore{
  color: yellow;
}


.flip3D{ width:240px; height:200px; margin:150px 60px; float:left; }
.flip3D > .front{
  position:absolute;
  transform: perspective( 600px ) rotateY( 0deg );
  background:#1E1E20; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D > .back{
  position:absolute;
  transform: perspective( 600px ) rotateY( 180deg );
  background: #80BFFF; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D:hover > .front{
  transform: perspective( 600px ) rotateY( -180deg );
}
.flip3D:hover > .back{
  transform: perspective( 600px ) rotateY( 0deg );
}

.pic1{
  border-radius: 7px;
}

.front{
  border: 2px solid yellow;
}

.projects{
  background-attachment: scroll;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

There seems to be an issue with the overlapping PROJECTS div. It continues scrolling down even after reaching its end, causing the background to become visible.

Here is the background image (grey.jpg)

And here is the image placed on top of the background (shadow.png)

I would like the scrolling effect to stop once it reaches the desired point.

For reference, visit this link.

Answer №1

*{
  margin: 0;
  padding: 0;
}

body{
  font-family: helvetica , sans-serif;
  background-color: #1E1E20;
}

.parallax-container {
  /* The image used */
  background-image: url("https://i.sstatic.net/BlFbi.jpg");
  animation-name: pixels;
  animation-duration: 800ms;
  animation-timing-function: steps(8,end);
  animation-delay: initial;
  animation-iteration-count: infinite;
  animation-play-state: initial;
  position: relative;
  /* Set a specific height */
  min-height: 800px; 
  /* Create the parallax scrolling effect */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@keyframes pixels {
  100% {
    background-position: 100% 0;
  }
}

.parallax img{
  z-index: 2;
  position: fixed;
  top: 0px;
  left: 0;
  right: 0;
  margin: 0 auto;
}

.header_nav_container a, h3, h4{
  font-family: Helvetica,sans-serif;
  font-size: 40px;
  font-weight: bold;
  color:white;
}

.header_nav_container h1{
  font-family: Helvetica, sans-serif;
  font-size: 80px;
  text-align: center;
  color: white;
  top: 250px;
  z-index: 4;
  position: relative;
}

.header_nav_container a{
  top: 50px;
  left: 50px;
  text-decoration: none;
  position: relative;
}

.header_nav_container h3{
  top: 50px;
  right: 50px;
  position: absolute;
}

.header_nav_container h4{
  top:90px;
  right: 50px;
  position: absolute;
  font-size: 30px;
  color: yellow;
}


.header_nav_container span{
  text-shadow: 8px 8px black;
}

.projects h1{
  position: relative;
  z-index: 5;
  font-size: 50px;
  text-align: center;
  color: white;
  font-family: helvetica, sans-serif;
  margin-top: 20px;
}

.front p{
  padding: 10px;
  text-align: center;
  font-family: helvetica, sans-serif;
  font-size: 30px;
  color:white;
}

.underscore{
  color: yellow;
}


.flip3D{ width:240px; height:200px; margin:150px 60px; float:left; }
.flip3D > .front{
  position:relative;
  transform: perspective( 600px ) rotateY( 0deg );
  background:#1E1E20; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D > .back{
  position:absolute;
  transform: perspective( 600px ) rotateY( 180deg );
  background: #80BFFF; width:300px; height:300px; border-radius: 10px;
  backface-visibility: hidden;
  transition: transform .5s linear 0s;
}
.flip3D:hover > .front{
  transform: perspective( 600px ) rotateY( -180deg );
}
.flip3D:hover > .back{
  transform: perspective( 600px ) rotateY( 0deg );
}

.pic1{
  border-radius: 7px;
}

.front{
  border: 2px solid yellow;
}

.projects{
  background-attachment: scroll;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}
.projects_container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    height: 100%;
    background-color:#1E1E20;
    position: relative; 
    top: 0px; 
    z-index: 3;
    margin-top: -80px;
}
<header>
  <div class="parallax-container">
    <nav class="header_nav_container">
      <h3>HAHAHA</h3>
      <br>
      <h4>Portfolio</h4>
      <a href="www.google.com/about">About</a>
      <h1>Hi,I'm <span>HAHA</span> </h1>
    </nav>
    <div class="parallax"><img src="https://i.sstatic.net/8pYB9.png" width="500px" 
      height="800px"></div>
  </div>
</header>
<section class="projects">
  <h1>PROJECTS<span class="underscore">_</span></h1>
  <div class="projects_container">
    <div class="flip3D">
      <div class="back">Box 1 - Back</div>
      <div class="front"></div>
    </div>
    <div class="flip3D">
      <div class="back">Box 2 - Back</div>
      <div class="front">Box 2 - Front</div>
    </div>
    <div class="flip3D">
      <div class="back">Box 3 - Back</div>
      <div class="front">Box 3 - Front</div>
    </div>
    <div class="flip3D">
      <div class="back">Box 4 - Back</div>
      <div class="front">Box 4 - Front</div>
    </div>
  </div>
</section>

https://jsfiddle.net/Sampath_Madhuranga/xpvt214o/616850/

Give this a try. It's functioning correctly. Please notify me if you encounter any issues. Thank you.

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

Creating a Custom Class for a Custom Button in TinyMCE 4 Using addButton()

Is there a way to add a custom class to a custom button using the addButton() function in TinyMCE? Here is an example: editor.addButton('keywords', { text: 'Insert Keywords', class: 'MyCoolBtn', ...

Warning displayed on form input still allows submission

How can I prevent users from inserting certain words in a form on my website? Even though my code detects these words and displays a popup message, the form still submits the data once the user acknowledges the message. The strange behavior has me puzzled. ...

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 ...

Use CSS alignment to combine both the profile picture and title on a webpage

Is there a way to seamlessly integrate a profile picture with text (title) on my tumblr theme? My main challenge lies in getting the alignment right. Additionally, I want it to look good in responsive view. If the title becomes too long, it should wrap un ...

Do we need to use aria-labelledby if we already have label and input associated with "for" and "id"?

Here is the HTML structure for the Text Field component from Adobe Spectrum: The <label> element has a for attribute and the <input> has an id which allows screen readers to read out the label when the input is focused. So, why is aria-label ...

Adjust the size of the <textarea> to match the height of the table cell

Below is the code I am using to generate a table containing an image along with a <textarea>: <table border="1" style="border-color: #a6a6a6" cellpadding="4" cellspacing="0" width="702">\ <col width="455"> <col width="230"> ...

Create a bokeh plot and save it as an HTML file without displaying it

Currently, I am utilizing Bokeh to generate HTML code that contains figures by employing the show method. However, this method automatically opens the default browser with the HTML displayed in it. My goal now is to save the HTML code without displaying i ...

Understanding the user's preference for text alignment and managing how the text is displayed in a text area (or text field) within a ReactJS application

My latest project is an app that features multiple text areas. Personally, I use the app with two languages - English and another language that is aligned to the right. However, the default setting has the text-areas aligning to the left. To change this ...

Tips for extracting text content that is not within an HTML element

Looking to extract data from this particular webpage: The information I'm interested in scraping includes Product Sku, Price, and List Price. I've successfully scraped the Price but I'm encountering issues with the other two, particularly t ...

Properly Positioning Text within React's Material UI Components

I am encountering a simple issue where I am trying to align '01/01/2020' with 'A00002'. To view my code on CodeSandbox, please visit CLICK HERE <div className={classes.root}> <Typography variant="h6" className={cla ...

What is the best method for gracefully opening external links in a reusable new tab?

Here is the progress I have made so far: <script> var win; function OpenInNewTab(url ) { // var win; if (win) { win.close(); } win =window.open(url, 'myWin'); win.focus(); } </script> My links are structured like ...

Customize tab background color in Material-UI by utilizing a styledTab component with a passed prop

I've customized this tab to have my desired style: import { withStyles } from "@material-ui/core/styles"; const StyledTab = withStyles((theme) => ({ root: { backgroundColor: "yellow", }, }))((props) => { const { shouldSetBackgroundCol ...

Tips on how to align bullet points in a list

I'm currently working on a little exercise that requires me to replicate this However, I'm facing some difficulty aligning the bullets as shown in the reference. My content is aligned but not the bullets. Here's the link This is my HTML: ...

Tips for transferring a double value from HTML to PHP

I need assistance in transferring a Double value (for example, 10.9) from an HTML file to PHP. Below is the HTML code I'm working with: <form action="AddProduct.php" method="POST" target="_self"> <table> ...

Exploring design techniques in React Native

I am currently part of a team working on a react native project with multiple contributors. My goal is to find an effective way to segregate the styling tasks from coding, allowing UI developers to work independently without relying on code developers. In ...

Create a wait function that utilizes the promise method

I need to wait for the constructor() function, which contains an asynchronous method handled by Promise. My goal is to wait for two asynchronous methods within the constructor, and then wait for the constructor itself. However, my code is throwing an err ...

Ensuring text is perfectly centered within a div, regardless of its length

In the quest to center text of unknown length within a div, challenges arise. Constraints limit its size to a certain extent, making it unclear whether one or two lines will be needed. As such, traditional methods like line-height are not viable options. A ...

Fade in/out overlay effect when clicking on a content block

I've hit a roadblock while trying to implement overlay fading in and out to cover a block created by some JavaScript code. Here is a link to the project. When you click on any of the continents, a series of blocks with country flags will appear. You& ...

Maintain the default material-ui class styles while making customizations to override others

Currently, I am working on customizing the material-ui tooltip and specifically need to adjust the margin for the tooltipPlacementTop class: const useStyles = makeStyles(theme => ({ tooltipPlacementTop: { margin: '4px 0' ...

Why does getElementById work when getElementsByClassName doesn't?

I created a script with the purpose of hiding images one and two, while keeping image 3 visible and moving it into their place. The script functions correctly when using div Id's instead of div Classes. However, I prefer to use div classes for groupin ...