If you are bored because you have to play with text and color in web design, let me introduce you to unique, bombshell, explosion-worthy property. OK, maybe not so much explosive but you are going to enjoy it. CSS follows and supports your willing to spice things up and that is why there is a transition option. About Transition The transition property allows changing the CSS property values smoothly.It is necessary to define a property that will be changed and the duration of the effect. button{ transition: background 1s; -webkit-transition: background 1s; /* Safari */} These two values can be defined with the universal property transition or with individual properties transition-property and transition-duration. Some of the transition-property values I can remember at the moment are: width, height, color, background (color, image, position) , transform (in the next post), border (color, width), position (top, bottom, left, right ), text (size, weight, shadow, word-spacing), margin, padding, opacity, visibility, z-index, all. If the value is defined with a property, defines a comma-separated list of CSS property names the transition effect is for. The value all is the default one and defines that all properties that can transition will transition. In this case, all changed properties will have a transition with the same **duration** (and **delay** and **timing** if defined). The transition-duration property is very simple, it defines how much time a transition effect takes to complete, and its value can be defined in seconds (s) or milliseconds (ms). More Transition Options Additional properties connected to transition are: transition-delay transition-timing-function Very similar to the duration property, transition-delay is defined with seconds (s) or milliseconds (ms) and specifies when the transition effect will start. This property can be negative, unlike the duration property, and if that so it will begin part-way through its play cycle. The transition-timing-function property is defined by the following functions: ease — slow start, fast middle, slow end, linear — constant speed, ease-in — slow start, fast end, ease-out — fast start, slow end, ease-in-out — more pronounced acceleration/deceleration curves that ease, cubic-bezier (n,n,n,n) — you can write your own function defined with 4 coordinates (cubic bezier functions). button{ transition: background 1s ease-in-out 2s; -webkit-transition: background 1s ease-in-out 2s; /* Safari */ } With the universal property transition you can define all four properties, just keep in mind that first time defined is always transition-duration. It’s possible to make the multiple transitions set. To split different transitions use ,. button{ transition: background 1s ease-in-out 2s, width 2s linear; -webkit-transition: background 1s ease-in-out 2s, width 2s linear; /* Safari */} Triggering The main thing to remember about the transition is that this property is defined before and it’s going to happen only if it’s triggered (if the property which is defined with transition-property is changed). You can trigger CSS transitions directly with pseudo-classes like :hover, :focus and :active or through JavaScript by adding or removing classes. Final Word This property is widely supported so use it! If you need some inspiration, check out this example. Originally published at kolosek.com on April 10, 2018. If you are bored because you have to play with text and color in web design, let me introduce you to unique, bombshell, explosion-worthy property. OK, maybe not so much explosive but you are going to enjoy it. CSS follows and supports your willing to spice things up and that is why there is a transition option . transition transition option About Transition The transition property allows changing the CSS property values smoothly.It is necessary to define a property that will be changed and the duration of the effect. define a property button{ transition: background 1s; -webkit-transition: background 1s; /* Safari */} button{ transition: background 1s; -webkit-transition: background 1s; /* Safari */} These two values can be defined with the universal property transition or with individual properties transition-property and transition-duration . transition transition-property transition-duration Some of the transition-property values I can remember at the moment are: transition-property width, height, color, background (color, image, position) , transform (in the next post), border (color, width), position (top, bottom, left, right ), text (size, weight, shadow, word-spacing), margin, padding, opacity, visibility, z-index, all. width, height, color, background (color, image, position) , transform (in the next post), border (color, width), position (top, bottom, left, right ), position text ( size , weight, shadow, word-spacing), size margin, padding, opacity, visibility, z-index, all. If the value is defined with a property, defines a comma-separated list of CSS property names the transition effect is for. The value all is the default one and defines that all properties that can transition will transition. In this case, all changed properties will have a transition with the same **duration** (and **delay** and **timing** if defined). value all value all In this case, all changed properties will have a transition with the same **duration** (and **delay** and **timing** if defined). The transition-duration property is very simple, it defines how much time a transition effect takes to complete, and its value can be defined in seconds (s) or milliseconds (ms). transition-duration More Transition Options Additional properties connected to transition are: transition-delay transition-timing-function transition-delay transition-delay transition-timing-function transition-timing-function Very similar to the duration property, transition-delay is defined with seconds (s) or milliseconds (ms) and specifies when the transition effect will start. This property can be negative, unlike the duration property, and if that so it will begin part-way through its play cycle. transition-delay The transition-timing-function property is defined by the following functions: transition-timing-function ease — slow start, fast middle, slow end, linear — constant speed, ease-in — slow start, fast end, ease-out — fast start, slow end, ease-in-out — more pronounced acceleration/deceleration curves that ease, cubic-bezier (n,n,n,n) — you can write your own function defined with 4 coordinates (cubic bezier functions). button{ transition: background 1s ease-in-out 2s; -webkit-transition: background 1s ease-in-out 2s; /* Safari */ } ease — slow start, fast middle, slow end, ease — slow start, fast middle, slow end, ease linear — constant speed, linear — constant speed, linear ease-in — slow start, fast end, ease-in — slow start, fast end, ease-in ease-out — fast start, slow end, ease-out — fast start, slow end, ease-out ease-in-out — more pronounced acceleration/deceleration curves that ease, ease-in-out — more pronounced acceleration/deceleration curves that ease, ease-in-out cubic-bezier (n,n,n,n) — you can write your own function defined with 4 coordinates (cubic bezier functions). button{ transition: background 1s ease-in-out 2s; -webkit-transition: background 1s ease-in-out 2s; /* Safari */ } cubic-bezier (n,n,n,n) — you can write your own function defined with 4 coordinates ( cubic bezier functions ). cubic-bezier (n,n,n,n) cubic bezier functions button{ transition: background 1s ease-in-out 2s; -webkit-transition: background 1s ease-in-out 2s; /* Safari */ } With the universal property transition you can define all four properties , just keep in mind that first time defined is always transition-duration . transition define all four properties transition-duration It’s possible to make the multiple transitions set. To split different transitions use , . , button{ transition: background 1s ease-in-out 2s, width 2s linear; -webkit-transition: background 1s ease-in-out 2s, width 2s linear; /* Safari */} button{ transition: background 1s ease-in-out 2s, width 2s linear; -webkit-transition: background 1s ease-in-out 2s, width 2s linear; /* Safari */} Triggering The main thing to remember about the transition is that this property is defined before and it’s going to happen only if it’s triggered (if the property which is defined with transition-property is changed). You can trigger CSS transitions directly with pseudo-classes like :hover, :focus and :active or through JavaScript by adding or removing classes. Final Word This property is widely supported so use it! If you need some inspiration, check out this example . this example Originally published at kolosek.com on April 10, 2018. Originally published at kolosek.com kolosek.com on April 10, 2018.