Use HTML5 to design different animations for the button background,

Source: Internet
Author: User

Use HTML5 to design different animations for the button background,

How to Use HTML5 to design different animation effects on the button background? In this special effect, when the mouse slides over the button, CSS3 animation is used to animation the background-size and background-position attributes, to achieve a variety of background animation effects.

Let's take a look at the overall situation:

 

Specific implementation:

1. CSS style

First, set a general style for the button. Remove the background of the button, set the solid border of 2 pixels, and set the bottom border to 4 pixels. Use padding to set the button size and set the smooth animation transition effect for the text color of the button.

The first button background animation:

In the first type of Button background animation, two gradient layers are used to create the button background. When the mouse slides over the button, the halftone Frame Animation is executed. The animation modifies the background-size attribute of the button. It reduces the size of the background image and connects all the dots.

Second, button background animation:

In the second type of Button background animation, linear gradient is used as the background image of the button. When you move the mouse over a button, you can modify the background-position attribute of the button to change the background position to form a zebra movement effect..

 

Third button background animation:

In the third type of Button background animation, use a gradient as the background image of the button. When you move the mouse over a button, you can modify the background-position attribute of the button to change the background position to form a point motion effect.

Fourth button background animation:

In the fourth type of Button background animation, The Tilde is used as the background image of the button. When you move the mouse over a button, you can modify the background-position attribute of the button to change the background position to form a wave motion.

5. Button background animation:

In the fifth type of Button background animation, a diagonal line is used as the background image of the button. When you move the mouse over a button, you can modify the background-position attribute of the button to change the background position to form a diagonal line.

6. Button background animation:

In the sixth type of Button background animation, a circular flashing gradient is used as the background image of the button. When you move the mouse over a button, you can modify the background-position attribute of the button to change the background position to generate a circular flashing effect.

This is the effect and code of each of the six buttons. In addition to this css style, you can also use some standard components to make it.

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.