Change Background With Animation Using CSS3

Datetime:2016-08-23 03:05:43          Topic: CSS3           Share

Tags:-CSS3 HTML

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. In this tutorial we will show you how to change or set multiple backgrounds with animation using CSS3.

See Demo

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.

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.





About List