Rotating Words with HTML and CSS

In this article, we will learn how to create Rotating Words Animation with using only HTML & CSS. Earlier in this blog, I have shared a couple of animation, but here in this blog, I am going to create a Rotating Words only with HTML and CSS. Apart from this, I have shared many Login Form design in my blog. Please make sure to check those as well.

Below is the video tutorials. watch and practices.

CSS Animation:

An animation we could an element steadily alternate from one style to every other. You can change as many css residences you want, as usually as you need. To apply css animation, you have to first specify some keyframes for the animation. Keyframes preserve what patterns the detail can have at positive instances.

The @keyframes Rule

When you specify CSS styles inside the @keyframes rule, the animation will gradually change from the current style to the new style at certain times. To get an animation to work, you must bind the animation to an element.

You may like this:

Source Code:

If you like this Rotating Words, then feel free to use it in your project. Copy the code by clicking on Copy button provided below. First, you have to create two files. One of them is HTML, and the other one is CSS. After creating the files, paste the code provided below.

<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Rotating Words | Code Info</title>
    <link rel="stylesheet" href="style.css">
    <div class="container">
        <p>Programming is</p>
        <div class="rotate">
@import url("");

body {
  background-color: #ae00ff;
  font-weight: bold;
  font-family: "Poppins", sans-serif;
  font-size: 16px;

.container {
  width: 250px;
  height: 65px;
  background: white;
  padding: 10px 18px;
  display: flex;
  margin: 200px auto;
  border-radius: 8px;
  box-shadow: 0 20px 25px rgba(58, 55, 55, 0.2);
p {
  margin-left: 18px;
.rotate {
  overflow: hidden;

span {
  display: block;
  height: 100%;
  padding-left: 10px;
  color: #ae00ff;
  animation: rotate_words 6s infinite;

@keyframes rotate_words {
  10% {
    transform: translateY(-75%);
  25% {
    transform: translateY(-79%);
  35% {
    transform: translateY(-176%);
  50% {
    transform: translateY(-180%);
  60% {
    transform: translateY(-275%);
  75% {
    transform: translateY(-280%);
  85% {
    transform: translateY(-373%);
  100% {
    transform: translateY(-380%);

I hope you liked this snippet. If so, please share the blog and follow us in our social media profiles and stay connected with this blog. Thank you for visiting.

Leave a Reply

Your email address will not be published. Required fields are marked *