Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

background color and font color transition

Tags:

css

I know how i can change bg-color and font color with transition in css3:

/**Background color transition**/
-webkit-transition: background-color 300ms linear;
-moz-transition: background-color 300ms linear;
-o-transition: background-color 300ms linear;
-ms-transition: background-color 300ms linear;
transition: background-color 300ms linear;

/**Font color transition**/
-webkit-transition-property:color, text;
-webkit-transition-duration: 1s, 1s;
-webkit-transition-timing-function: linear, ease-in;

-moz-transition-property:color, text;
-moz-transition-duration:1s;
-moz-transition-timing-function: linear, ease-in;

-o-transition-property:color, text;
-o-transition-duration:1s;
-o-transition-timing-function: linear, ease-in;

My question is, i can set two transitions (bg and font color) in same class? Thanks!.

like image 288
Stefan Luv Avatar asked Jul 07 '14 00:07

Stefan Luv


1 Answers

You can use short hand transitions as follows if you want to combine them:

CSS

-webkit-transition: background-color 300ms linear, color 1s linear;
-moz-transition: background-color 300ms linear, color 1s linear;
-o-transition: background-color 300ms linear, color 1s linear;
-ms-transition: background-color 300ms linear, color 1s linear;
transition: background-color 300ms linear, color 1s linear;
like image 150
josh.gaby Avatar answered Oct 20 '22 17:10

josh.gaby