Design a Parallax Webpage using HTML and CSS Last Updated : 30 Jul, 2024 Comments Improve Suggest changes Like Article Like Report A parallax website includes fixed images in the background that are kept in place and the user can scroll down the page to see different parts of the image. In this article, we are creating a parallax webpage using HTML and CSS. We will use basic tags of HTML like div, paragraph, and heading to write our content and will use CSS to align and beautify our basic HTML design.Basically, the Scrolling effect is where background images move at a different speed than the foreground images.Approach:We have used a container element and added a background image to the container. Then we used the background-attachment: fixed to create the actual parallax effect.For each HTML section, we have given a class so that it can be targeted in the CSS.In the HTML page, we have divisions and in each division, there is a header and a small paragraph. In the CSS file, we decorated our text and placed the head in a fixed position.Example: HTML <!DOCTYPE html> <html lang="en"> <head> <style> /* Styling the body */ * { margin: 0px; padding: 0px; } /* Styling the first parallax's height, width and background color */ .parallax-1 { width: 100%; height: 600px; background: url( 'https://media.geeksforgeeks.org/wp-content/uploads/20210402175040/back22.jpg'); background-size: 100% 100%; background-attachment: fixed; } /* Styling the title of first parallax */ .parallax-1 h2 { margin: auto; position: relative; left: 500x; top: 300px; width: 250px; height: 32px; padding: 10px; background-color: black; color: white; text-align: center; } /* Styling the second parallax's height, width and background color */ .parallax-2 { width: 100%; height: 600px; background: url( 'https://media.geeksforgeeks.org/wp-content/uploads/20210402175040/back22.jpg'); background-size: 100% 100%; background-attachment: fixed; } /* Styling the title of second parallax */ .parallax-2 h2 { margin: auto; position: relative; left: 500x; top: 300px; width: 250px; height: 37px; padding: 10px; background-color: white; color: black; text-align: center; font-size: 30px; font-family: Verdana; } /* Styling the content or paragraph */ .para-1 { padding: 50px; background-color: black; color: white; font-size: 17px; } /* Styling the content or paragraph */ .para-2 { text-align: center; padding: 25px; font-size: 17px; font-family: Verdana; background-color: black; color: white; } </style> </head> <body> <!-- Giving title of the first parallax --> <div class="parallax-1"> <h2>SUSHANT GAURAV</h2> </div> <!--Content of first parallax --> <div class="para-1"> <p> Thankyou for showing interest, here is a quick story of me and this website. My programming journey started back in 2019, few months before I started studying CSE in LNCT Bhopal. I am currently in my second year and doing Technical Content Writing Internship at GeeksForGeeks. I like coding all kind of problems from the very basic like adding numbers to the complex ones like competitive programming problems. I love making projects and games. Infact this website is one of my Web Development Projects which is built using HTML and CSS.<br> <br>Languages known : C Language, C++, JAVA, Python, JavaScript, MySQL.<br> IT Constructs : Data Structures and Algorithm, OOP, HTML, CSS, LINUX, and Git & GitHub. </p> </div> <!-- Giving title of the first parallax --> <div class="parallax-2"> <h2>PROJECTS</h2> </div> <!--Content of first parallax --> <div class="para-2"> <p> Calendar ☀ Tic-Tac-Toe ☀ Quiz Game ☀ Survey Form ☀ Chat Bot in C ☀ Tribute Webpage ☀ Portfolio Website ☀ Guess the Number ☀ Rock Paper Scissor ☀ To-Do List using JS ☀ Notes Taker using JS ☀ BMI Calculator using JS ☀ Loan Calculator using JS ☀ Travel Management System ☀ Random Password Generator ☀ Different Management Systems </p> </div> <!--This will be same as first parallax--> <div class="parallax-1"> <h2>ACHIEVEMENTS</h2> </div> <div class="para-2"> <p> Technical Content Writer Intern at GeeksForGeeks ☀ Microsoft Learn Student Ambassador - Beta ☀ Participant in GirlScript Summer of Code 2021 ☀ Mentored HackTX Hackathon </p> </div> </body> </html> Output: Comment More infoAdvertise with us Next Article Design an Event Webpage using HTML and CSS imsushant12 Follow Improve Article Tags : Web Technologies Web Templates HTML-Tags CSS-Properties CSS-Selectors HTML-Questions CSS-Questions +3 More Similar Reads How to Create a Website Using HTML and CSS? Creating a website using HTML and CSS is a foundational skill if you are learning web development. HTML (HyperText Markup Language) is used to structure content, while CSS (Cascading Style Sheets) is used for styling, including colors, fonts, margins, and positioning. In this article, weâll go throu 5 min read Design a Tribute Page using HTML and CSS Making a tribute page is an Innovative way to honor someone special in your life. In this article, we create a tribute webpage using HTML and CSS. This page has a simple and creative design. It contains a header with a title, a main section with text and images, and a footer for main details or cred 4 min read Build a Survey Form using HTML and CSS Creating a survey form is a great way to understand the basics of web development. In this article, we will build a Survey Form that allows users to easily submit their responses. The form will include different input types such as text fields, checkboxes, and radio buttons, all designed using HTML 4 min read Design a Parallax Webpage using HTML and CSS A parallax website includes fixed images in the background that are kept in place and the user can scroll down the page to see different parts of the image. In this article, we are creating a parallax webpage using HTML and CSS. We will use basic tags of HTML like div, paragraph, and heading to writ 4 min read Design an Event Webpage using HTML and CSS Creating an event webpage is an exciting way to showcase information about an event, including its schedule, speakers, and contact details. What Weâre Going to CreateWeâll create a webpage for a fictional event called "GeeksforGeeks TechCon 2025." This webpage will includeA header introducing the ev 5 min read Design a Webpage for online food delivery system using HTML and CSS Creating your own online food delivery website is a great way to present a user-friendly platform for customers to browse and order food online. In this project, weâll design a simple yet effective food delivery website using HTML and CSS.What Weâre Going to Create...Weâll develop a straightforward 7 min read Create a Homepage for Restaurant using HTML , CSS and Bootstrap HTML: HTML stands for Hyper Text Markup Language. It is used to design web pages using a markup language. HTML is a combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within the tag which defines the s 6 min read How to create a Landing page using HTML CSS and JavaScript ? A landing page, also referred to as a lead capture page, static page, or destination page, serves a specific purpose and typically appears as a result of online advertising or search engine optimization efforts. Unlike a homepage, a landing page is stripped of distractions and focuses on capturing v 7 min read Design a Webpage like Technical Documentation using HTML and CSS In this article, we will design a webpage-like technical documentation using HTML and CSS . Technical documentation is any document that explains the features of the respective product. In this project, we are going to create technical documentation of C++ by using HTML and CSS. The webpage has a me 9 min read Create a Music Website Template using HTML, CSS & JavaScript A Music Website Template is a pre-designed layout for creating a music-themed webpage. By utilizing HTML, CSS, and JavaScript, developers can craft a functional and visually appealing website with features like play/pause controls, sections for home, music, about, and contact.Step-by-Step Guide to c 3 min read Like