CSS transitions, part of the draft CSS3 specification, provide a way to animate changes to CSS properties, instead of having the changes take effect instantly.

#content {
    -webkit-transition: margin-left 1s ease-in-out;
    -moz-transition: margin-left 1s ease-in-out;
    -o-transition: margin-left 1s ease-in-out;
  
    display: inline;
    height: 20px;
    background: red;
    color: white;
}
#content.left {
    margin-left: 0;
}
#content.right {
    margin-left: 780px;
}
 

Leave a Comment

You must be logged in to post a Review.