Jumping Text Animation

In this tutorial, you will learn how to add a jumping animation to a text using CSS. Watch the video below for a detailed tutorial.


HTML

<body>
  <h1>
    <span>W</span>
    <span>i</span>
    <span>n</span>
    <span>t</span>
    <span>e</span>
    <span>r</span>
    <span>w</span>
    <span>i</span>
    <span>n</span>
    <span>d</span>
    </h1>
</body>

CSS

body {
	background-color: #2e3537;
	margin: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
}

h1 {
	font-family: 'Arial', sans-serif;
	text-transform: uppercase;
}

h1 span {
	position: relative;
	font-size: 4rem;
	color: #79B9D6;
	top: 0;
	animation: jump 0.5s ease infinite alternate;
}

@keyframes  jump {
	100% {
		top: -50px;
	}
}

h1 span:nth-child(2) {
	animation-delay: 0.1s;
}

h1 span:nth-child(3) {
	animation-delay: 0.2s;
}

h1 span:nth-child(4) {
	animation-delay: 0.3s;
}

h1 span:nth-child(5) {
	animation-delay: 0.4s;
}

h1 span:nth-child(6) {
	animation-delay: 0.5s;
}

h1 span:nth-child(7) {
	animation-delay: 0.6s;
}

h1 span:nth-child(8) {
	animation-delay: 0.2s;
}

h1 span:nth-child(9) {
	animation-delay: 0.3s;
}