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
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • jQuery
  • AngularJS
  • ReactJS
  • Next.js
  • React Native
  • NodeJS
  • Express.js
  • MongoDB
  • MERN Stack
  • PHP
  • WordPress
  • Bootstrap
  • Tailwind
  • CSS Frameworks
  • JS Frameworks
  • Web Development
Open In App
Next Article:
How to Vertically Align Text Next to an Image using CSS ?
Next article icon

How to make a vertical wavy text line using HTML and CSS ?

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

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 attributes. The main “body” part is created byusing <span> tag inside <body> tag. CSS code is used to create wavy texts of the “body” part of the HTML structure.

HTML code: The following code snipp et demonstrates the design of the text used for wavy effect by using HTML tags in the web page.

html
<div class="wavy">     <span style="--i:1">G</span>     <span style="--i:2">E</span>     <span style="--i:3">E</span>     <span style="--i:4">K</span>     <span style="--i:5">S</span>     <span style="--i:6"> </span>     <span style="--i:7">F</span>     <span style="--i:8">O</span>     <span style="--i:9">R</span>     <span style="--i:10"> </span>     <span style="--i:11">G</span>     <span style="--i:12">E</span>     <span style="--i:13">E</span>     <span style="--i:14">K</span>     <span style="--i:15">S</span>     <span style="--i:16">.</span>     <span style="--i:17">.</span>     <span style="--i:18">.</span>     <span style="--i:19">.</span>     <span style="--i:20">.</span> </div> 

Final code:

This example displaying the complete code to make a vertical wavy text line using HTML and CSS.

HTML
<!DOCTYPE html> <html>  <head>     <meta charset="utf-8">     <style type="text/css">         body {             display: flex;             justify-content: center;             align-items: center;             min-height: 100vh;             background-color: rgb(6, 75, 21);         }          .wavy {             position: relative;         }          .wavy span {             position: relative;             display: inline-block;             color: #fff;             font-size: 2em;             text-transform: uppercase;             animation: animate 2s ease-in-out infinite;             animation-delay: calc(0.1s * var(--i));         }          @keyframes animate {             0% {                 transform: translateY(0px);             }              20% {                 transform: translateY(-20px);             }              40%,             100% {                 transform: translateY(0px);             }         }     </style> </head>  <body>     <div class="wavy">         <span style="--i:1">G</span>         <span style="--i:2">E</span>         <span style="--i:3">E</span>         <span style="--i:4">K</span>         <span style="--i:5">S</span>         <span style="--i:6"> </span>         <span style="--i:7">F</span>         <span style="--i:8">O</span>         <span style="--i:9">R</span>         <span style="--i:10"> </span>         <span style="--i:11">G</span>         <span style="--i:12">E</span>         <span style="--i:13">E</span>         <span style="--i:14">K</span>         <span style="--i:15">S</span>         <span style="--i:16">.</span>         <span style="--i:17">.</span>         <span style="--i:18">.</span>         <span style="--i:19">.</span>         <span style="--i:20">.</span>     </div> </body>  </html> 

Output:

qwe


Next Article
How to Vertically Align Text Next to an Image using CSS ?
author
chalti
Improve
Article Tags :
  • Web Technologies
  • Web Templates

Similar Reads

  • How to add lines besides a vertical text using SASS ?
    In this article, we will see how to add lines besides some vertical text using SASS. Approach: The HTML code is used to depict the basic structure of the body. Here, we define a division element with a class of wrapper to contain subsequent division elements. Another division element with a class of
    6 min read
  • How to Vertically Align Text Next to an Image using CSS ?
    Adding images into our websites is a common practice, and there are situations where text must be vertically aligned alongside an image. For example, a user’s name should appear immediately next to their profile picture, vertically aligned for optimal readability . In this article, we will see how t
    2 min read
  • How to create Vertical Menu using HTML and CSS ?
    In This article, we will learn how to create vertical menus by using HTML and CSS. Vertical Menu: We can create a vertical menu in the form of buttons and a scrollable menu. Vertical Menu is the buttons arranged in the vertical menu bar/navbar. How to create a vertical menu using buttons: We can cre
    2 min read
  • How to wrap the text around an image using HTML and CSS?
    Here are three methods to make text around an image using HTML and CSS: 1. Using Float PropertyThe float property is the traditional way to position an image and allow text to wrap around it. [GFGTABS] HTML <html> <head> <style> .image-left { float: left; margin-right: 15px; } <
    2 min read
  • How to Shake Text on hover using HTML and CSS?
    Shaking Text animation is a very cool animation which can be used in websites, this animation can be easily created using some basic HTML and CSS, the below section will guide on how to create the animation. HTML Code: In this section we have a basic div element which contains some text inside of it
    2 min read
  • How to Make a Vertical Line in HTML
    To make a vertical line in HTML we can use the border-left or border-right property. The height property is used to set the height of the border (vertical line) element. The position property is used to set the position of the vertical line. Here is the preview image of the Vertical Line. Now, let's
    2 min read
  • How to Skew Text on Hover using HTML and CSS?
    Skewed text animation effect can be created using HTML and CSS, this animation looks very cool and can be used in websites to make them look more dynamic, the following sections will guide on how to create the desired animation effect. First Section: In this section we will create a basic div tag wh
    2 min read
  • How to Make Vertical Card Sliding Animation using only HTML & CSS ?
    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. Approach :Firstly use the H
    3 min read
  • How to Set Vertical Space Between the List of Items using CSS?
    Vertical space refers to the distance between elements arranged vertically on a webpage. In CSS, it can be set between list items using properties like margin or padding etc. These properties help create a visually appealing layout, enhancing readability and organization of the content. Below are th
    4 min read
  • How to create Vertical Navigation Bar using HTML and CSS ?
    After reading this article, you will be able to build your own vertical navigation bar. To follow this article you only need some basic understanding of HTML and CSS. Let us start writing our vertical navigation bar, first, we will write the structure of the navigation bar. In this tutorial, we crea
    3 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