How To Create Live Changing Background in HTML.
HTML Code
- <html>
- <head>
- <meta charset="UTF-8">
- <title>live change background color in html css </title>
- <link href="css/mycss.css" rel="stylesheet">
- </head>
- <body>
- <h1>Coming Soon</h1>
- </body>
- </html>
CSS Code
- body
- {
- margin: 0px;
- padding: 0px;
- animation: live_bgcolor infinite 20s;
- }
- h1
- {
- margin:300px auto auto auto;
- padding: 0px;
- font-family: Verdana;
- font-size: 70px;
- color: #fff;
- text-align: center;
- }
- @keyframes live_bgcolor
- {
- 0%
- {
- background-color: #2ecc71;
- }
- 10%
- {
- background-color: #27ae60;
- }
- 20%
- {
- background-color: #1abc9c;
- }
- 30%
- {
- background-color: #16a085;
- }
- 40%
- {
- background-color: #3498db;
- }
- 50%
- {
- background-color: #2980b9;
- }
- 60%
- {
- background-color: #8e44ad;
- }
- 70%
- {
- background-color: #e74c3c;
- }
- 80%
- {
- background-color: #e67e22;
- }
- 90%
- {
- background-color: #d35400;
- }
- 100%
- {
- background-color: #f39c12;
- }
- }
Other Blog
No comments: