From the course: CSS: Animation

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

CSS transitions

CSS transitions - CSS Tutorial

From the course: CSS: Animation

CSS transitions

- [Narrator] CSS transitions are one of the ways we can create animation with CSS even though they're not called animations. It's confusing, but true. By definition, animation means causing change over time and transitions absolutely do that. They just do it in a different way then CSS key frame animations do. Let's start with creating a button that transforms on hover to take a quick look at what CSS transitions can do. Transitions need a beginning and end state to transition between, that's why we tend to use them for things like hover states. The initial styles on our element, like what we're seeing here, are the beginning state and the hover states we define end up being our end state. So let's start by defining our hover state first. We'll go to our CSS and a hover state for our button and on hover, I'd like to have this button both grow a little bit and change color. So we'll add a transform with a scale to have…

Contents