Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • CSS Tutorial
  • CSS Exercises
  • CSS Interview Questions
  • CSS Selectors
  • CSS Properties
  • CSS Functions
  • CSS Examples
  • CSS Cheat Sheet
  • CSS Templates
  • CSS Frameworks
  • Bootstrap
  • Tailwind
  • CSS Formatter
Open In App
Next Article:
How to Create Sliding Text Reveal Animation using HTML & CSS ?
Next article icon

How to Make Vertical Card Sliding Animation using only HTML & CSS ?

Last Updated : 24 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The vertical card slider serves as an engaging way to showcase content, such as profiles, products, or services, in a modern web design. In this tutorial, we'll see the creation of a visually appealing vertical card slider with smooth animation effects using HTML and CSS.

Screenshot-2024-02-26-123722

Approach :

  • Firstly use the HTML to structure the cards and their content.
  • Now applying CSS to style the cards and create animation effects.
  • Define the animation keyframes for the sliding effect. Start with the cards hidden below the viewport, then gradually move them up, show them, move them down, and hide them again.
  • Use the keyframe animations to achieve the sliding effect.
  • You can control animation delay using custom CSS properties.

Example: Implementation to make a vertical sliding animation.

HTML
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport"            content="width=device-width, initial-scale=1.0">     <title>Vertical Card Scrolling Animation</title>     <link rel="stylesheet" href="styles.css"> </head>  <body>     <h1>GeeksforGeeks</h1>     <h3>Vertical Card Sliding Animation</h3>     <div class="cont">         <div class="cards">             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <div class="card">                 <p class="card-text"></p>             </div>             <!-- Add more cards here as needed -->         </div>     </div> </body>  </html> 
CSS
body {   margin: 100px 0 0 0;   padding: 0;   box-sizing: border-box;   font-family: Montserrat;   background: rgb(219, 113, 113); }  .cont {   display: grid;   place-items: center;   min-height: 180px;   -webkit-mask-box-image: -webkit-linear-gradient(     top, transparent, transparent 0, white 10%, white 80%, transparent 100%); }  h1, h3 {   color: green;   text-align: center; }  .cards {   position: relative;   display: flex;   align-items: center;   justify-content: center;   flex-direction: column; }  .card-text {   background-color: blue; }  .cards .card {    position: absolute;   display: grid;   grid-template-columns: 70px 1fr;   gap: 10px;   padding: 1.5rem;   opacity: 0;   background: #fff;   max-width: 30rem;   border-radius: 0.5rem;   pointer-events: none;   animation: slideUp 15s infinite; }  .cards .card:nth-child(1) {   animation-delay: -3s; }  .cards .card:nth-child(2) {   animation-delay: 0s; }  .cards .card:nth-child(3) {   animation-delay: 3s; }  .cards .card:nth-child(4) {   animation-delay: 6s; }  .cards .card:nth-child(5) {   animation-delay: 9s; }  .cards .card:nth-child(6) {   animation-delay: 12s; }  .cards .card:nth-child(7) {   animation-delay: 15s; }  .cards .card:nth-child(8) {   animation-delay: 18s; }  .cards .card:nth-child(9) {   animation-delay: 21s; }  .cards .card:nth-child(10) {   animation-delay: 24s; }  .cards .card:nth-child(11) {   animation-delay: 27s; }  .cards .card:nth-child(12) {   animation-delay: 30s; }  .cards .card:nth-child(13) {   animation-delay: 33s;   /* Repeat from 1 after the 10th card */ }  .cards .card:nth-child(14) {   animation-delay: 36s;   /* Repeat from 2 after the 11th card */ }  /* Continue this pattern for more cards */  @keyframes slideUp {   0% {     transform: translateY(100%) scale(0.5);     opacity: 0;   }    5%,   20% {     transform: translateY(100%) scale(0.7);     opacity: 0.4;   }    25%,   40% {     transform: translateY(0) scale(1);     opacity: 1;   }    45%,   60% {     transform: translateY(-100%) scale(0.7);     opacity: 0.4;   }    65%,   100% {     transform: translateY(-100%) scale(0.5);     opacity: 0;   } } 

Output:

cds


Next Article
How to Create Sliding Text Reveal Animation using HTML & CSS ?
author
ujjwalshrivastava2309
Improve
Article Tags :
  • Web Technologies
  • HTML
  • CSS
  • Web Templates
  • Dev Scripter
  • Dev Scripter 2024

Similar Reads

  • How to Create Sliding Text Reveal Animation using HTML & CSS ?
    In this article, we will implement sliding text reveal animation which can be used in personal portfolios, websites, and even in YouTube introduction videos to add an extra edge to our videos so that it looks more interesting and eye-catchy at first instance and the best part is that we will do that
    3 min read
  • How to Make Responsive Vertical Timeline Design using only HTML and CSS ?
    A Timeline is a list of events according to the order of dates which is used to get an overview of various tasks and their expected timing. Crafting a responsive vertical timeline design using only HTML and CSS involves making a visually pleasing layout that arranges content chronologically in a ver
    5 min read
  • How to make photo sliding effect using HTML and CSS ?
    It is an easy and amazing animation effect created with HTML and CSS, where the photos are moving horizontally one by one like a roller. When the mouse pointer comes upon the photo then the specific photo stops moving. Approach: The basic idea of these animation comes from the hover effect of CSS an
    5 min read
  • How to make a vertical wavy text line using HTML and CSS ?
    In this article, a wavy animated text is implemented using HTML and CSS. It is one of the simplest CSS effects. For a beginner, it is one of the best examples to learn the concept of CSS pseudo-elements. Approach: The basic idea of getting wavy texts is performed by using the combination of some CSS
    2 min read
  • How to make a morph spinner animation using CSS ?
    Morphing is the rotating animation of certain objects changing their shape. The changing of shape is called morphing. In this article, we will make a morph spinner that will act as a loading animation by using CSS. This method can also be used to make eye-catching card backgrounds, banners, buttons,
    3 min read
  • How to Create Animation Loading Bar using CSS ?
    Loading Bar with animation can be created using HTML and CSS. We will create a Loader that is the part of an operating system that is responsible for loading programs and libraries. The progress bar is a graphical control element used to visualize the progression of an extended computer operation, s
    3 min read
  • How to Create a Dot loading Animation using HTML and CSS?
    The Dot Loading animation can be used to enhance the user interface of a website, it can be added while the website loads. This animation can be easily created using HTML and CSS. HTML Code: In this section we will create the basic structure of the dot loader using a div tag which will have some spa
    2 min read
  • How to make a Animated Table using HTML and CSS ?
    Table is an arrangement of data in rows and columns, or possibly in a more complex structure. Tables are widely used in communication, research, and data analysis. In this article, we are going to create a Table with animation over its columns. We are going to implement it using HTML and CSS. Approa
    3 min read
  • How to make Card Flipping Animation in HTML & CSS ?
    This animation makes web pages more fun and interesting. It's great for showing off things you want to sell or making web pages more exciting for people to use. This animation can help retain users for more time due to interaction. Here we will create a card-flipping animation on the hover of the mo
    3 min read
  • Create Scanning Animation Loader using HTML & CSS
    In this article, we will learn how to create a Scanning Animation. This can be used to add interactivity to the loader page. This is approached by simple HTML & CSS.  Glimpse of the Project: Approach: We will first create an HTML file in which we are going to add a div for adding a span in it.We
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences