or, in shorthand:
transition: color 2s, transform 300ms 1s;
transition-duration
transition-delay
transition-property
transition-property: color, transform;
transition-duration: 2s, 300ms;
transition-delay: 0, 1s;
.animated-div {
animation: black-to-white 1s linear 1;
}
@keyframes black-to-white {
0% { background: black; }
100% { background: white; }
}
.animated-div {
animation: black-to-white 1s linear 2s 2;
}
@keyframes black-to-white {
0% /* or from */ {
background: black;
color: white;
}
100% /* or to */ {
background: white;
color: black;
}
}
@keyframes black-to-white {
0% { color: black; }
50% { color: grey; }
100% { color: white; }
}
one value: keyword, length, or percentage on X axis
two values: keyword, length, or percentage on X and Y axes
three values: X, Y, and an offset for Y
four values: X, offset for X, Y, offset for Y
/* keyword */
background-position: top;
background-position: bottom;
background-position: left;
background-position: right;
background-position: center;
/* <percentage> */
background-position: 25% 75%;
/* <length> */
background-position: 1cm 2cm;
/* offsets */
background-position: bottom 10px right 20px;
background-position: right 3em bottom 10px;
background-position: bottom 10px right;
background-position: top right 10px;