transition for the scss code example

Example 1: mixin for transition css

/* Mixin for transition css */
@mixin transition($for: all, $time-in: 250ms, $type: ease-in-out, $time-out: 0s) {
    transition: $for $time-in $type $time-out;
    -moz-transition: $for $time-in $type $time-out;
    -webkit-transition: $for $time-in $type $time-out;
    -o-transition: $for $time-in $type $time-out;
}

/* IE10 (the first stable version of IE to support transition)
does not require the -ms- prefix. */

Example 2: css background color transition

/* Answer to: "css background color transition" */

/*
  Transitions currently work in Safari, Chrome, Firefox, Opera and
  Internet Explorer 10+.

  The following should produce a fade effect for you on the browsers
  mentioned above:
*/

a {
    background-color: #FF0;
}

a:hover {
    background-color: #AD310B;
    -webkit-transition: background-color 1000ms linear;
    -ms-transition: background-color 1000ms linear;
    transition: background-color 1000ms linear;
}

Tags:

Html Example