Display the cover image of the page as you scroll through the content

Trying to implement a scrolling effect where the content covers an image from this tutorial video. The issue I'm encountering is that the image is not a background image but an actual image tag. Here's my current code:

<section id="home" class="bgWrapper">
<img id="parallaxImg" class="bgImg" src="images/bg/bizlifter-design-bg.jpg">
<!--<div id="parallaxImg"></div>-->
<article id="signUp" class="areaMargin">
    <h1>Business smart</h1>
    <h3>One simple system for your business.</h3>
    <div class="purple"></div>
    <div id="signupRow">
        <input type="text" placeholder="    <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2a444b474f6a4945475a4b445304494547">[email protected]</a>">
        <a id="btn-start" class="btn btn-lg btn-primary btnWhite" href="#">Start</a>
        <a id="btn-free" class="btn btn-lg btn-primary btnWhite" href="#">It's free!</a>
    </div>
    <p class="forwardSlash"><span class="purpleText">
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    </span></p>
    <a class="btn btn-primary btn-lg googleBtn" href="#">Sign Up Using Google</a>
</article>

The image I want to cover is identified by id="parallaxImg" on line two.

Answer №1

To achieve the effect demonstrated in the video, you can enclose your image within one div and your covering content within another. By utilizing these two divs, you have the ability to manipulate their layers using CSS z-index. When you set the position of the image-div to "fixed", the text will scroll while the image remains fixed in place.

For more information on CSS z-index, visit: http://www.w3schools.com/cssref/pr_pos_z-index.asp

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

Guide to executing two child processes sequentially in Node JS

I am working on two processes within a function: one generates a JSON file from an audio while the other normalizes the generated JSON file. However, I'm facing an issue where only one of the processes runs at a time - when the first one runs, the se ...

Tips to prevent modal impacts on underlying elements?

When I click on a button, a modal pops up. However, the background contents seem to spread out and sometimes scroll automatically when the modal appears. I have searched for a solution to this issue but have been unsuccessful. Can anyone please help me ide ...

What could be causing the malfunction of the dynamic Bootstrap version 3 date picker?

Just starting out with Twitter Bootstrap version 3 and I found an example at this link. I want to add multiple date ranges dynamically, like repeating the process 'n' number of times. Everything works fine when done manually. However, when try ...

Dropdown selection values were not set appropriately

I've been encountering an issue with setting the selected value in a drop-down list using the code below. The values are being split from a comma-separated string, but it's not functioning as intended. When I use string='text1,text2,text3,t ...

Using Flask and jQuery, learn how to toggle the visibility of a reply text box

After a break from using HTML/JavaScript, I find myself a bit puzzled about how to handle this. I'm working on creating a reddit-like clone with Flask. I've reached a point where I can add child comments to any comment and have them display nic ...

Creating a countdown clock with JavaScript

I am looking to create a timer using JavaScript that will decrement at different intervals based on the level. For example, if my timer starts at 500, I want it to decrement as follows: 1. The first level timer should decrement by 1 with a slow speed. ...

The left and right arrows maintain their visibility even when they are outside of the image

I am a beginner in the world of web development and I am trying to implement left and right navigation for images using arrows. My goal is to have the arrows fade in when the mouse hovers over the image and fade out when it's moved away. However, I am ...

elevate the shadow of the menu bar above the background image

How can I ensure that the drop shadow of the menu appears in front of a background image within a div? See below for my CSS code nav { width:900px; margin: 4px auto 0px 8%; font-size: 16pt; padding-bottom: 0px; -moz-box-shadow: 7px ...

Setting the width of individual Views within a ScrollView to adjust accordingly in React Native

Is there a way to ensure that the Views inside my horizontal ScrollView have the same dimensions as the ScrollView itself? I'd like to implement paging so that swiping takes me to the next View within the ScrollView. I attempted using width : "100%" b ...

Looking to transmit data to your HTML page and incorporate AJAX for your Single Page Application on a NodeJS server with express.js framework?

Is there a way to display the form submitted data on a different HTML page? I am collecting user data on the 1st page (page1.html) and after storing this data in the database, I want to showcase the submitted values on another page, specifically (page4.ht ...

Revise a function that locates an object with a corresponding id in an array, modifies a property, and updates a React component's state

Here is a function that takes in a rating value within an object. The ID and Question properties remain unchanged, but the rating value can be updated. This will result in updating a React state value. Is there a method to improve the readability and con ...

I am looking to create a line similar to the one shown in the attached image using HTML and CSS

I am trying to create a line similar to the image provided using HTML/CSS. https://i.sstatic.net/skZOd.png I attempted to achieve this using two different divs but did not get the desired result. Any suggestions on how to accomplish this? I have experi ...

Inspect HTML elements using Jinja2 placeholders

I am a beginner in the world of web development, currently learning how to create Flask webapps. I am using Atom along with some addons like PreviewHTML to help me visualize live previews of my HTML code. However, I am facing an issue where I cannot see a ...

Tips for integrating Apache Solr with Cassandra without using DataStax Enterprise (DSE)

Embarking on a new project, I find myself utilizing Cassandra as the chosen DBMS, with Apache Solr serving as the search engine and Node.js powering the server scripting language. While I am well-versed in Node.js, Cassandra and Solr are unfamiliar territ ...

Display a Bootstrap input button group addon, where the first button has rounded corners only after the second button has been hidden

I am working on a button group and need to hide the second button dynamically. However, I am facing an issue where the first button has a 90° border. How can I adjust the code below to display button 1 with a rounded border? If I decide to hide "button ...

What is the best way to display and conceal various elements with each individual click?

Utilizing the onClick function for each triggering element, I have implemented a show/hide feature for multiple element IDs upon click. The default setting is to hide the show/hide elements using CSS display property, except for the initial 3 main elements ...

Tips for utilizing 'toHaveClass' to find a partial match in Jest?

When I assign the class success to an element, React-Mui appends additional text to it in the DOM, such as mui-AbcXYZ-success. This causes my test using the code snippet below to fail: expect( getByTestId('thirdCheck')).toHaveClass("success ...

Node.js encountered an error: Address already in use. The specified port 8080 is currently being utilized by another application

My application was not functioning properly, and upon running the command "npm start", an error was thrown: Error: listen EADDRINUSE: address already in use :8080 Even after restarting my EC2 instance and attempting the command again, I encount ...

What is the best way to position a box in the center using CSS?

I have constructed a container using div and included 4 additional div elements inside: HTML: <div className='main__container'> <div className='item'>Image</div> <div className='item'>N ...

The serialize() function in jQuery is not functioning as expected

Greetings to all! I attempted to serialize a form using the jQuery method serialize() by its unique ID. Here is the HTML code snippet: <form name="structure_form" id="structure_form" method="post"> <div id="add_sections" class="postbox add_s ...