SitePoint
  • Blog
  • Discord
  • Forum
  • Library
  • Login
Join Premium

CSS Animation 101

Close
  1. Preface
    • CSS Animation 101
    • Abstract
  2. 1Welcome
    • Hello, I’m Donovan
    • Book structure
    • Help and support
    • Need to brush up on your CSS?
    • Homework
  3. Why animate?
    • More than words alone
    • What is animation on the web?
    • With great power comes great responsibility
    • Inspiration
    • Summary
    • Homework
  4. Creative environments
    • In the browser
    • Local development
    • In summary
    • Homework
  5. Transitions
    • Transitions
    • Transition properties
    • In summary
    • Homework
  6. Animations
    • Animation in the browser
    • Examples
    • Transitions vs. Animations
    • Homework
  7. Transitions in action
    • Transitions
    • Example: Button transition
    • Prefixes and browser compatibility
    • Homework
  8. Transitions properties
    • Shorthand vs Longhand
    • Things transitions don’t work on
    • Homework
  9. Timing functions
    • Linear
    • Ease-in
    • Ease-out
    • Ease-in-out
    • Cubic-bezier
    • Steps
    • More examples
    • Homework
  10. Multiple transitions
    • Example 1: Fancy button
    • Example 2: Background reveal
    • Multiple transitions on a single element
    • Homework
  11. Transitions and JavaScript
    • Add or remove classes
    • Controlling transitions with JavaScript
    • Let’s recap
    • Homework
  12. Animations in action
    • A symbiotic relationship
    • The animation property
    • Keyframes
    • Prefixes
    • Homework
  13. Animation properties
    • Using timing functions within keyframes
    • Homework
  14. Keyframes in action
    • Things to look out for
    • Example: Save button wiggle effect
    • Homework
  15. Multiple animations
    • Traffic lights
    • Further reading
    • Homework
  16. Animation recap
    • Homework challenge: Traffic lights
    • Recap: Animations
    • Putting them together
    • Homework
  17. Storytelling
    • Heroes
    • Example: Scrolling background
    • Part 1: Background animation
    • Part 2: Adding the hover transition
    • Summary
    • Homework
  18. Star Wars
    • Transform: Not an animation property
    • Transform: scale(), translateZ() and rotateY()
    • SVG, HTML and CSS
    • Animating the Star and Wars
    • Making it 3D
    • The Force Awakens
    • Homework
  19. Revealing content on scroll
    • Wow.js
    • Using Wow.js
    • Adding “wow” classes
    • Hiding and showing
    • Using Animate.css
    • Using Modernizr
    • Homework
  20. Accessibility
    • Make sure content is accessible
    • Give control
    • Allow for alternate inputs
    • Confusion
    • Don’t make me sick
    • Accessibility is for everyone’s benefit
    • Homework
  21. Now you know CSS animation!
    • CSS Animation cheatsheet
    • Resources to bookmark
    • Other tools
    • Next steps
    • Don’t be a stranger, now
  22. Level up your CSS animation skills!

Welcome

“Tell me and I forget. Teach me and I remember. Involve me and I learn.” Benjamin Franklin

Welcome to CSS Animation 101, and thank you for choosing this book.

I’m delighted you’ve chosen to learn CSS animation. This book is a light and fun introduction to the topic, and I hope you find it helpful. We’re going to learn about CSS transitions and animations. By the end you’ll have a good understanding of CSS animations as well as the tools to create and experiment with our own.

There will be both theory and practical examples. We’ll learn how to easily create your own working environment, and look at lots of examples of animation along the way.

Hello, I’m Donovan

Donovan Hutchinson

Donovan Hutchinson

I’ve been writing articles about CSS and other topics for the best part of a decade. I’ve also been designing and developing websites since the late 90’s. More recently, I’ve written for Smashing Magazine, Net Magazine, Tuts+, Adobe Inspire and more. I post random stuff at Hop.ie, and this year I’ve been writing tutorials on CSSAnimation.rocks, all about advanced and useful animations in the browser.

During my days I work as a designer and front-end developer, and I’m a big fan of combining UX principles with fun animations in design. In the evenings I write blogs and try to make sure I’m aware of what’s happening in the world of web design.

This book is an introduction to the topic of CSS animation, but along the way we’ll cover a lot of material. The goal is to make sure we understand what the transition and animation properties are for, how they work, and see them in action.

By the end of this book you should be confident enough to begin applying animation to your projects.

Book structure

Here’s what we’re going to cover.

First: What’s animation anyway? This week we’ll look at why we animate. We’ll also introduce the transition and animation properties and some sources of inspiration.

Then: All about the transition property. We’ll learn how transitions work, and the properties we can control to change the movement.

After that: We’ll take on the animation property, and learn how to create keyframes that go beyond simple transitions.

Lastly: Bringing it all together. We’ll put together some advanced examples that make use of both, look into how we can make sure our work is accessible, and share some helpful CSS resources we can apply to projects, and JavaScript tools we can use for more advanced effects.

Help and support

I love to hear from you with your questions and thoughts. Feel free to drop me an email at donovan@cssanimation.rocks, or tweet me at [@donovanh](https://twitter.com/donovanh) at any time.

Need to brush up on your CSS?

If you’re new to CSS, it might be worth taking time to get familiar with the concepts. You don’t need to be an expert in CSS. If you know what a property is, you’ll be fine.

Some online tools and resources you might find helpful:

  • Interactive HTML/CSS tutorials
  • Learn to Code HTML&CSS

Homework

You’ll notice each chapter ends with a little homework section. This is entirely up to you but if you like you can use this to help with your learning. Each homework section will have a suggestion for something to try or think about. Give it a little time and you’ll find your understanding of CSS animation will be even better.

Ready? Let’s learn all about CSS animation!

End of PreviewSign Up to unlock the rest of this title.

Community Questions