A simple hover animation effect,

Source: Internet
Author: User

A simple hover animation effect,

HTML:

<Div id = "demo1" class = "demo"> demo1 </div> <div id = "demo2" class = "demo"> demo2 </div>

 

CSS:

. Demo {width: 100px; height: 100px; text-align: center; line-height: 100px; border: 10px solid # ccc; border-radius: 60px; font-size: 20px;-webkit-backface-visibility: hidden} # demo1 {transition: border-color. 3 s response} # demo1: hover {border-color: # a3d7ff} # demo2 {transition: all 1 s response} # demo2: hover {background-color: # a3d7ff; transform: rotate (360deg); transition: background-color. 3 s timeout}

Note: If the results cannot be viewed, add the prefix parameters of different browsers. this parameter is omitted for ease of reading.

From the normal state to the floating state, the two effects are the same, that is, normal-> hover transitions to the animation
• The transition effect written in hover from the suspension to the Removal state is a switching (normal-> hover transition to animation, hover-> normal reverse animation transition ), however, the transition written in the normal state quickly disappears without any delay, that is, there is no transition from hover-> normal.

 




Related Article

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.