CSS Transitions

Written by: John | 20th Oct 2016

CSS Transitions

Easy copy ‘n’ paste CSS to apply a 0.3 second transition to all of an element’s properties. “All” will add the transition to all properties, but can be used by naming individual properties of the element EG: ‘height’ or ‘color’.

.your-class{
   -webkit-transition: all 0.3s ease-in-out;
   -moz-transition: all 0.3s ease-in-out;
   -o-transition: all 0.3s ease-in-out;
   transition: all 0.3s ease-in-out;
   color: blue;
   font-size: 14px;
}
//on hover change colour & font size
.your-class:hover{
   color: red;
   for-size: 18px;
}

 

Related Posts

Code

Swipe close for mobile menu

Using Vanilla JS (ish) to add swipe features to mobile views.
Code

Full Width YouTube Videos

Make YouTube videos take the full width of an element while retaining the 16:9 ratio.
Code

Command Line SSH stuff

Some tips and tricks for using the command line to do useful stuff, mainly just a reference for myself.
Code

Handy, dandy WordPress excerpt length function

If you have been using WordPress on multiple projects you must have come up against needing to pull a custom excerpt size? Now there are many ways to do this, eg, you could use this to pull say 80 characters…
Code

Add a masonry blog to WordPress

Masonry post display So you have seen the fancy shmancy "Masonry blog" blog pages used on many modern WordPress sites and thought, that would look great on my site... Well here's how to add a masonry blog to WordPress without…