InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

CSS animation

  • animation overview
  • animation-name
  • animation-duration
  • animation-timing-function
  • animation-delay
  • animation-iteration-count
  • animation-direction
  • animation-fill-mode
  • animation-play-state
  • animation shorthand
 
  • Home
  • > Tutorials
  • > CSS
  • > CSS properties
  • > CSS Animation

CSS animation shorthand property

on Mar 25, 2016

CSS animation shorthand property is a comma-separated list of animation definitions, each of which combines animation properties into a single component value. Note that individual animation properties should be in order.

CSS property animation

CSS version: CSS 3
Value: [animation-name || animation-duration || timing-function || animation-delay || animation-iteration-count || animation-direction || animation-fill-mode || animation-play-state] [, ...]*
Initial: see individual properties
Applies to: all elements, ::before and ::after pseudo-elements
Inherited: see individual properties

Example – animation shorthand

<style>
@keyframes left-to-right {
  0% {left:0;}
  60% {left:200px;}
  100% {left:200px;}
}
.box {
  position: fixed;
  background-color:lightgreen;
  /* name, duration, timing-function, delay, iteration-count */
  animation: left-to-right 4s linear 0s infinite;
}
</style>

<div class=box>Object</div>
refresh done
try it online

Specification

  • W3C CSS 3 animation specification

Suggested posts:

  1. CSS animation-duration
  2. CSS – align div in center vertically
  3. CSS animation-iteration-count
  4. CSS animation-timing-function
  5. CSS animation-name
  6. CSS animation-fill-mode
  7. CSS animation-direction
  8. jQuery – how to get version info
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged CSS, CSS Animation, CSS properties, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress