CSS3 Animation: CSS3 to implement beautiful button animation

Source: Internet
Author: User
Tags count implement

Chrome under the effect of ideal, FIREFOX,IE9 no animation effect.
CSS code fragment
. button,. button:visited{
Background: #222 URL (overlay.png) repeat-x;
Display:inline-block;
padding:5px 10px 6px;
Color: #fff;
Text-decoration:none;
/*border-radius*/
-webkit-border-radius:6px;
-moz-border-radius:6px;
border-radius:6px;
/*box-shadow*/
-webkit-box-shadow:0 1px 3px Rgba (0,0,0,0.6);
-moz-box-shadow:0 1px 3px Rgba (0,0,0,0.6);
box-shadow:0 1px 3px Rgba (0,0,0,0.6);
text-shadow:0 -1px 1px rgba (0,0,0,0.25);
border-bottom:1px solid Rgba (0,0,0,0.25);
position:relative;
Cursor:pointer;
}
. button:hover{
Background-color: #111;
Color: #fff;
/*animation-duration*/
-webkit-animation-duration:2s;
-moz-animation-duration:2s;
-ms-animation-duration:2s;
-o-animation-duration:2s;
Animation-duration:2s;
/*animation-timing-function*/
-webkit-animation-timing-function:ease-out;
-moz-animation-timing-function:ease-out;
-ms-animation-timing-function:ease-out;
-o-animation-timing-function:ease-out;
Animation-timing-function:ease-out;
/*animation-iteration-count*/
-webkit-animation-iteration-count:infinite;
-moz-animation-iteration-count:infinite;
-ms-animation-iteration-count:infinite;
-o-animation-iteration-count:infinite;
Animation-iteration-count:infinite;
}
/* Define Animation/*
@-webkit-keyframes greenpulse{
From {background-color: #91bd09;
/*box-shadow*/
-webkit-box-shadow:0 0 9px #333;
-moz-box-shadow:0 0 9px #333;
box-shadow:0 0 9px #333;
}
50%{
Background-color: #B4E02C;
/*box-shadow*/
-webkit-box-shadow:0 0 18px #91bd09;
-moz-box-shadow:0 0 18px #91bd09;
box-shadow:0 0 18px #91bd09;
}
to{
Background-color: #91bd09;
/*box-shadow*/
-webkit-box-shadow:0 0 9px #333;
-moz-box-shadow:0 0 9px #333;
box-shadow:0 0 9px #333;
}
}
. Green.button,. green.button:visited{
Background-color: #91bd09;
}
. green.button:hover{
/*animation-name*/
-webkit-animation-name:greenpulse;
-moz-animation-name:greenpulse;
-ms-animation-name:greenpulse;
-o-animation-name:greenpulse;
Animation-name:greenpulse;
}
HTML code Fragment
<ul>
<li>
<a class= "button Magenta Super" href= "#" > button </a>
<a class= "button Green Super" href= "#" > button </a>
<a class= "button Red Super" href= "#" > button </a>
<a class= "button Orange Super" href= "#" > button </a>
<a class= "button Blue Super" href= "#" > button </a>
<a class= "button Yellow Super" href= "#" > button </a>
</li>
<li>
<input type= "button" class= "button Magenta Super" value= "button"/>
<input type= "button" class= "buttons Green Super" value= "Pushbutton"/>
<input type= "button" class= "button Red Super" value= "button"/>
<input type= "button" class= "button Orange Super" value= "buttons"/> This article link http://www.cxybl.com/html/wyzz/CSS/20130614/ 38595.html

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.