New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

CSS: Transitions and Transforms
Illustration by

Understanding keyframes and animations


From:

CSS: Transitions and Transforms

with Joseph Lowery

Video: Understanding keyframes and animations

As we've seen throughout the course, there's a ton of possibilities with transitions and transforms, but for traditional animators, it doesn't have anywhere near the degree of control they are used to. Luckily, there is another set of options in the CSS3 tool chest that we can tap for everything from percentage-based timelines to infinite iterations. There are two primary elements for more sophisticated Motion Graphics are the @keyframes statement and the animation properties. The @keyframes statement is similar to the @media or @import statements.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
CSS: Transitions and Transforms
2h 25m Intermediate Jul 11, 2012

Viewers: in countries Watching now:

With robust and ever-increasing browser support, it is now possible to take advantage of expressive CSS3 capabilities across modern browsers. In this course, Joseph Lowery explores the possibilities of the new coding options, which animate well over 50 different properties automatically or interactively, and how they open the door to enhanced user experiences. This course covers the range from simple to complex transitions, including 2D and 3D transforms, and illustrates how transitions are expedited in various web authoring tools, as well as Dreamweaver. The course also contains a start-to-finish interactive slideshow project that allows you to practice and see the transitions and transforms immediately in action.

Topics include:
  • Understanding transition basics
  • Working with 2D and 3D transforms
  • Animating color changes
  • Fading objects
  • Changing the size of page elements and fonts
  • Transitioning multiple properties at the same time
  • Understanding keyframes and animations
  • Working in the z-index
  • Adding JavaScript interactivity
  • Crafting transitions in Dreamweaver
Subjects:
Web Web Design Web Development
Software:
CSS
Author:
Joseph Lowery

Understanding keyframes and animations

As we've seen throughout the course, there's a ton of possibilities with transitions and transforms, but for traditional animators, it doesn't have anywhere near the degree of control they are used to. Luckily, there is another set of options in the CSS3 tool chest that we can tap for everything from percentage-based timelines to infinite iterations. There are two primary elements for more sophisticated Motion Graphics are the @keyframes statement and the animation properties. The @keyframes statement is similar to the @media or @import statements.

The code is inserted in the external stylesheet or within an embedded style tag and can be formatted either with percentage-based values, like the example on the left, or keyword, like example the right. In either case you'll need to give it a unique name, like I have here with myAnimation and yourAnimation. The animation properties are added to the CSS rule for the selector to be affected, just like transform properties. There is a shorthand version that's often used. Let's step through the most commonly applied syntax.

Right after the animation property is the animation name, which is the same as the one referenced in the @keyframes statement. Next is a duration, which can be given in seconds, s, or milliseconds, ms. Then you have the option for setting the number of times to repeat the animation. This can be of value like 3 or 6 or the keyword infinite, which causes the animation to repeat as long as it's on the screen. The final parameter in our example is the keyword alternate, which designates the animation direction.

As you might suspect, alternate will go back and forth. The other possible value is a keyword normal, which causes the animation to play in a start to finish direction. Here's a list of the majority of cross browser animation properties that can be used, if you don't want to code with shorthand syntax. Note that a couple of these, like animation-timing-function and animation-delay, work exactly like their transition equivalents. The @keyframes in animation properties are supported in browsers about as well as 3D transforms, and it's getting better quickly, as you can see from the caniuse web site.

Okay, that's enough of a bird's eye view. You are ready now to get your hands dirty with keyframes and animations.

There are currently no FAQs about CSS: Transitions and Transforms.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed CSS: Transitions and Transforms.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.