css3--animation effects

Source: Internet
Author: User

CSS3 animation in the style of the implementation of the previous we use JQ write animation effect, really easy a lot ~

Simple demo:

HTML code:

<div id= "Dv1" ></div>

CSS3 Code:

<style type= "Text/css" >

#dv1 {width:100px;height:100px;border:1px solid blue; -webkit-animation:myfirst 3s; Position:relative;}

@webkit-keyframes{

0%{left:0px;top:0px;}

25%{left:200px;top:0px;}

50%{left:200px;top:200px;}

75%{left:0px;top:200px;}

100%{left:0px;top:0px;}

}

</style>

--------------------below shows a demo that keeps the circle spinning

The code is as follows:

<! DOCTYPE html>"Text/css">#dv1 {width:100px;height:100px;border:100px solid green; Border-left-color:yellow;border-top-color:red;border-bottom-Color:blue; Border-radius: -%; -webkit-animation:myanimation 3s infinite linear; }    @-webkit-keyframes myanimation{0%{transform:rotate (0deg);}  -%{transform:rotate (360deg);} }    </style>"Dv1"></div></body>

css3--animation effects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.