All TalkersCode Topics

Follow TalkersCode On Social Media

devloprr.com - A Social Media Network for developers Join Now ➔

Change Background With Animation Using CSS3

Last Updated : Jul 1, 2023

IN - CSS3 HTML | Written & Updated By - Anjali

In this tutorial we will show you how to change or set multiple backgrounds with animation using CSS3, Website background is always the main center of attraction everyone wants to set beautiful background and in modern days people also try to set different backgrounds and animations in background to make their website beautiful.

You may also like animated background using CSS3.

Change Background With Animation Using CSS3

To Change Background With Animation It Takes Only One Step:-

  1. Make a HTML file and define markup and styling

Step 1. Make a HTML file and define markup and styling

We make a HTML file and save it with a name background.html

<html>
<head>
<style>
body
{
 text-align:center;
 width:100%;
 margin:0 auto;
 padding:0px;
 font-family:helvetica;
 animation: back_animate 25s infinite linear;
}
@keyframes back_animate 
{
 0%{background-color:#3B240B;} 
 10% {background-color:#FF8000;}
 20%{background-color:#ACFA58;}
 30%{background-color:#298A08;}
 40%{background-color:#81F7D8;}
 50%{background-color:#088A68;}
 60%{background-color:#5882FA;}
 70%{background-color:#0B2161;}
 80%{background-color:#BE81F7;}
 90%{background-color:#170B3B;}
 100%{background-color:#424242;}
}
h1
{
 margin-top:200px;
 color:white;
 font-size:40px;
}
h1 p
{
 font-size:14px;
}
</style>
</head>
<body>

<h1>Change Background With Animation Using CSS3 And HTML</h1>

</body>
</html>

In this step we use CSS3 keyframes to change background color in different time. You may also like fullscreen background video using HTML5.

Thats all, this is how to change background with animation using CSS3 and HTML. You can customize this code further as per your requirement. And please feel free to give comments on this tutorial.

I hope this tutorial on background color animation css helps you and the steps and method mentioned above are easy to follow and implement.