Create a text rotation effect

To make your site more attractive, you could add this cool effect, which will display several words in succession with a looping deletion and rewriting effect. This effect can be placed at the end of a sentence, as in a text.
•
Updated on August 14, 2026
•
2 min read
Believemy logo

To make your website more attractive, you can add this cool effect, which will display multiple words that will follow one another with a deletion and retyping effect in a loop. This effect can be placed at the end of a sentence like in a text.

 

Step 1

Let's start by inserting the libraries into the HTML code.

HTML
<head>
    <meta charset="UTF-8">
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.11/typed.min.js"></script>
</head>

We will simply insert the libraries we need. In this case, jQuery and Typed.

The first (jQuery) will allow us to code our animation much more quickly, while the second (Typed) will enable us to create our animation with an effect that gives the impression that someone is typing and deleting the text.

 

Step 2

The HTML code.

HTML
<body>
  <div class="presentation">I am, <span class="texte"></span></div>
</body>

We will need the .texte class contained within the span tag to add the text we want to appear and then disappear in a loop automatically.

 

Step 3

Style the presentation class.

CSS
.presentation {
    font-weight: bold;
    font-size: 20px;
    }

 

Step 4

We will now handle the rotation.

JAVASCRIPT
$(document).ready(function(){
    var typed = new Typed(".texte", {
        strings: ["developer", "freelancer","blogger"],
        typeSpeed: 80,
        backSpeed: 60,
        loop: true
    });
});

In the previous step, we used jQuery to wait for the page to fully load before adding our animation.

Once our page is loaded, we use the Typed function, which allows us to define the strings of characters to display (strings).

For managing the typing, we will use typeSpeed and backSpeed for deletion. We then specify whether we want the animation to loop continuously or not using loop.

Congratulations! Your animation is ready!

Category: Developers

Share this article

Want to help us? Share this article on your networks or even better: on your site, in an article or in your newsletter.

Believemy logo
Comments (0)

You need to be logged in to comment on this article: log in or sign up.

Read next

Creating a cascading animation on text

For a slogan or for an animation on a very important page of your project, this very modern effect is also very easy to achieve. Let's take a look at how to do it in this article.

December 9, 2024

Create an animated gradient background on hover avec CSS

Whether it's to highlight a part of your website or a quote as in this example, generating and adding a gradient to the background can give your website a very modern touch. Find out in this article how to do it easily!

December 9, 2024

Create a map displaying links on mouse-over with CSS

To present your team or simply yourself, this animation will allow you to display the links to your social networks when you hover over the map: a striking effect guaranteed! Let's find out how to do it together.

December 9, 2024

Create an animated "rainbow" button with CSS

In this article, we'll show you how to create a rainbow button that comes to life when the mouse hovers over it. A modern and sensational effect guaranteed!

December 9, 2024

Create a glitch effect on mouse-over with CSS

Add a modern glitch effect to your presentations or your logo, whether it's hovering or permanent! Let's find out how.

December 9, 2024

Create a clean, modern timeline using html and css

Whether you want to show a purchasing process, the highlights of your career on your portfolio, or anything else, learn how to create a sleek, modern timeline to show it off!

December 9, 2024

Creating text with integrated background

If you're looking for a very modern and effective way to style your headlines, take a look at how using a background to style the colour of your text can be incredibly innovative.

December 9, 2024

Creating animated presentation cards with JavaScript

Whether you're presenting the team behind your project or anything else, using animated presentation cards will give your page a successful finishing touch. Find out how in this article!

December 9, 2024

Become the solopreneur you dream of being.

First project, career change, business launch: access our courses, practice on real-world cases, and move forward with clear guidance.