HOW TO CREATE TEXT CHANGING ANIMATION USING CSS | CSS EFFECTS |

CREATE TEXT CHANGING ANIMATION USING CSS .

Today, We will learn text changing animation effect using HTML and CSS. This text animation effect is very easy to implement and it's very useful because you can add multiple words when you want to describe a product and a service. 

In the section of html, we have div wrapper inside another div which contain all text and tag also have a span which will animate using CSS. Now, we have to add few lines of CSS to animate the structure. Basically we will give the structure a fixed height and overflow hidden. So all words will be hidden, then just move the inner content up and down to create this text animation effect.



Now Basic Steps to follow in CSS:

Step 1:

Do basic style like background-color, text-color, margins, padding etc.

Step 2:

Now, use to set the content of span to an initial word.

Step 3:

Use animation property to set the total time for the animation.

Step 4:

Now, use keyframes to change the content property that was set in before selector for each text frame.


It's like a slider but the best part is that you don't have to add any JavaScript, with just few lines of CSS and html you can create this nice animation.


index.html


style.css

Note:

Note: You can set the total time according to your need and you want to change text animation. In our Case, we have four words and we have used 0.3s or 1.5s as total time. You can use 2, 4, 5… so on. Setting time as multiple of the total number of words will ensure that each word gets displayed for an equal amount of time.

2/Post a Comment/Comments

Post a Comment

Previous Post Next Post