Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Let’s say that along with the background color, we also want to change the link’s text color and transition that as well. We can do that by stringing multiple transitions together, separated by a comma. Each can have their varying duration and timing functions (FIG 2.03).
a.foo {
padding: 5px 10px;
background: #9c3;
-webkit-transition: background .3s ease, color 0.2s linear;
-moz-transition: background .3s ease, color 0.2s linear;
-o-transition: background .3s ease, color 0.2s linear;
transition: background .3s ease, color 0.2s linear;
}
a.foo:hover,
a.foo:focus {
color: #030;
background: #690;
}
FIG 2.03: The normal and :hover states of the link.