Skip to content

Instantly share code, notes, and snippets.

@emrekilinc
Created September 12, 2015 11:49
Show Gist options
  • Save emrekilinc/559b911cd2cb82340ddd to your computer and use it in GitHub Desktop.
Save emrekilinc/559b911cd2cb82340ddd to your computer and use it in GitHub Desktop.
CSS3 Animation - Background colour
<p id="notification">This is the notification stuff.</p>
body {
background-color: gray;
}
#notification {
border: 1px solid white;
padding: 20px;
background-color: transparent;
width: 300px;
margin: 0 auto;
animation: bg-color 1.5s 3, bg-color2 5.5s infinite;3
animation-delay: 0s, 4.5s;
-webkit-animation: bg-color 1.5s 3, bg-color2 5.5s infinite;
-webkit-animation-delay: 0s, 4.5s;
}
@-webkit-keyframes bg-color {
0% {
background-color: transparent;
}
66% {
background-color: red;
}
100% {
background-color: transparent;
}
}
@keyframes bg-color {
0% {
background-color: transparent;
}
66% {
background-color: red;
}
100% {
background-color: transparent;
}
}
@-webkit-keyframes bg-color2 {
80% {
background-color: transparent;
}
90% {
background-color: blue;
}
100% {
background-color: transparent;
}
}
@keyframes bg-color2 {
80% {
background-color: transparent;
}
90% {
background-color: blue;
}
100% {
background-color: transparent;
}
}
p {
font-family: Meiryo, "Hiragino Kaku Gothic Pro W3", sans-serif;
text-align: center;
color: #fff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment