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 Loading Blur Text Animation Effect using HTML and CSS?
Next article icon

How to Create Jumping Text 3D Animation Effect using CSS ?

Last Updated : 24 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

In this article, you will learn to implement Jumping Texts animation effect using simple HTML and CSS. HTML is used to create the structure of the page and CSS is used to set the styling.

HTML Code: In this section, we will design the basic structure of the body.

html
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport" content=       "width=device-width, initial-scale=1.0">     <title>Text Jumping effect</title>     <link rel="stylesheet" href="style.css"> </head>  <body>     <h1>         <span>G</span>         <span>e</span>         <span>e</span>         <span>k</span>         <span>s</span>         <span>f</span>         <span>o</span>         <span>r</span>         <span>G</span>         <span>e</span>         <span>e</span>         <span>k</span>         <span>s</span>     </h1> </body>  </html> 

CSS Code: In this section, we will use some CSS property to design the Jumping text.

The CSS text-shadow property applies to create shadow to the text. It accepts a list of shadows separated by comma. The list will be applied to the text for its decorations. Some combination of X and Y offsets from the element describes each of the shadow. We are using @keyframes for the animation code. The animation is created by gradually changing from one set of CSS to another one. The change of all styles happen in percentage or the style change happens by using the keywords “from” and “to”, which is the same as 0% and 100%. The set of CSS can be changed many times. CSS code:

CSS
html, body {     width: 100%;     height: 100%;     background: black;     -webkit-font-smoothing: antialiased;     display: flex;     justify-content: center;     align-items: center; }  h1 {     height: 100px; }  h1 span {     position: relative;     top: 20px;     display: inline-block;     animation: bounce .3s ease infinite alternate;     font-family: 'Titan One'cursive;     font-size: 80px;     color: #fff;     text-shadow: 0 1px 0 green,         0 2px 0 green,         0 3px 0 green,         0 4px 0 green,         0 5px 0 green,         0 6px 0 transparent,         0 7px 0 transparent,         0 8px 0 transparent,         0 9px 0 transparent,         0 10px 10px rgba(0, 0, 0, 0.4); }  h1 span:nth-child(2) {     animation-delay: .1s; }  h1 span:nth-child(3) {     animation-delay: .2s; }  h1 span:nth-child(4) {     animation-delay: .3s; }  h1 span:nth-child(5) {     animation-delay: .4s; }  h1 span:nth-child(6) {     animation-delay: .5s; }  h1 span:nth-child(7) {     animation-delay: .6s; }  h1 span:nth-child(8) {     animation-delay: .7s; }  @keyframes bounce {     100% {         top: -20px;         text-shadow: 0 1px 0 #CCC,             0 2px 0 #CCC,             0 3px 0 #CCC,             0 4px 0 #CCC,             0 5px 0 #CCC,             0 6px 0 #CCC,             0 7px 0 #CCC,             0 8px 0 #CCC,             0 9px 0 #CCC,             0 50px 25px rgba(0, 0, 0, 0.2);     } } 

Complete Code: It is the combination of the above two code sections.

html
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport" content=         "width=device-width, initial-scale=1.0">      <title>Text Jumping effect</title>      <style>         html, body {             width: 100%;             height: 100%;             background: black;             -webkit-font-smoothing: antialiased;             display: flex;             justify-content: center;             align-items: center;         }          h1 {             height: 100px;         }          h1 span {             position: relative;             top: 20px;             display: inline-block;             animation: bounce .3s ease infinite alternate;             font-family: 'Titan One'cursive;             font-size: 80px;             color: #fff;             text-shadow: 0 1px 0 green,                 0 2px 0 green,                 0 3px 0 green,                 0 4px 0 green,                 0 5px 0 green,                 0 6px 0 transparent,                 0 7px 0 transparent,                 0 8px 0 transparent,                 0 9px 0 transparent,                 0 10px 10px rgba(0, 0, 0, 0.4);         }          h1 span:nth-child(2) {             animation-delay: .1s;         }          h1 span:nth-child(3) {             animation-delay: .2s;         }          h1 span:nth-child(4) {             animation-delay: .3s;         }          h1 span:nth-child(5) {             animation-delay: .4s;         }          h1 span:nth-child(6) {             animation-delay: .5s;         }          h1 span:nth-child(7) {             animation-delay: .6s;         }          h1 span:nth-child(8) {             animation-delay: .7s;         }          @keyframes bounce {             100% {                 top: -20px;                 text-shadow: 0 1px 0 #CCC,                     0 2px 0 #CCC,                     0 3px 0 #CCC,                     0 4px 0 #CCC,                     0 5px 0 #CCC,                     0 6px 0 #CCC,                     0 7px 0 #CCC,                     0 8px 0 #CCC,                     0 9px 0 #CCC,                     0 50px 25px rgba(0, 0, 0, 0.2);             }         }     </style> </head>  <body>     <h1>         <span>G</span>         <span>e</span>         <span>e</span>         <span>k</span>         <span>s</span>         <span>f</span>         <span>o</span>         <span>r</span>         <span>G</span>         <span>e</span>         <span>e</span>         <span>k</span>         <span>s</span>     </h1> </body>  </html> 

Output:

https://media.geeksforgeeks.org/wp-content/uploads/20240723202448/3d3.mp4


Next Article
How to Create Loading Blur Text Animation Effect using HTML and CSS?
author
nehaahlawat
Improve
Article Tags :
  • CSS
  • Web Technologies
  • Web Templates
  • Write From Home

Similar Reads

  • How to Create Loading Blur Text Animation Effect using HTML and CSS?
    The blur text animation is known as the Smoky effect and is used to give the text a blurry animation. The text blurs linearly in one direction and then reappears. In this article, we will create a loading blur text animation effect using HTML and CSS. Approach: The approach to create loading blur te
    3 min read
  • How to create Shooting Star Animation Effect using CSS ?
    The Shooting Star effect is one of the coolest background effects that is used for dark-themed websites. Shooting Stars Animation is an extraordinary illustration of a loading screen that grabs your eye for a considerable length of time for the remainder of the content to load on the website. This e
    4 min read
  • How to Create Text Changing Animation Effect using CSS ?
    A CSS text-changing animation effect involves dynamically altering displayed text, typically through transitions or keyframe animations. This effect can smoothly switch between words or phrases, enhancing visual engagement. It’s achieved using CSS properties like animation, transition, and keyframes
    2 min read
  • How to create Incoming Call Animation Effect using CSS ?
    In this article, we will learn how to create an incoming call animation effect, by using CSS. Approach: To create this effect, we essentially need to animate the shadow effects around the element frame, which can be easily manipulated using the CSS box-shadow property. It is described by X and Y off
    2 min read
  • How to create text-fill animation using CSS ?
    A text-fill animation using CSS is a visual effect where the content of text gradually fills with a color, gradient, or pattern over time. This animation can create dynamic, eye-catching effects for headings or titles by adjusting properties like background-size, clip-path, or keyframe animations. A
    2 min read
  • How to Create Text Animation Effect using JavaScript ?
    Creating text animations in JavaScript can add an extra layer of interactivity and engagement to a website or application. By using JavaScript, we can create text that moves, fades, changes color, or transforms in other ways. Animating text can also help convey important information or messages in a
    2 min read
  • Create a 3D Text Effect using HTML and CSS
    The 3D text effect is one of the most used text effects in the web design world. As a designer or front-end developer, one should know how to create a 3D text effect. Today we will be looking at one of the simplest and easiest methods to create text in a 3D look with HTML and CSS. ApproachCreate an
    2 min read
  • How to Create Text Color Animation using HTML and CSS ?
    The text color can be changed according to the programmer’s choice using CSS @keyframes rule. In this article, we will see how to create text color animation using HTML and CSS. Preview:Approach:Create an HTML file with a centered <div> containing an <h2> element.Use CSS to reset default
    1 min read
  • Create Effect of Particle Animation using CSS
    At least once, you must have seen a website with particles appearing and disappearing in its background. This cool particle animation may seem complicated but it is actually quite easy to make. In this article, we will set an image as the background of our body, and on it, we will have particles mov
    6 min read
  • How to create Drawing Effect Animation using CSS ?
    Drawing effect animation can be implemented using CSS animation. The used images can be modified or edited as per requirement. Save the images in SVG file format. The animation is created by drawing a simple art using lines and curved lines. The CSS stroke-dashoffset property defines the location al
    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