Home > Article > Web Front-end > Detailed example of mouse over button special effects based on CSS3 animation
Brief Tutorial
This is a set of mouse-over button animation special effects made using CSS3 animation. This set of mouse-over button animations has 13 final effects, all of which are created by pseudo-elements of buttons and CSS3 animation.
##View Demo Download plug-in
How to use
HTML structure
This effect uses hyperlinks to create buttons. For example, the HTML code of the first Swipe effect is :
<a class="btn-0" href="#">Swipe</a>
CSS style
## For convenience, the special effects are except 5a8028ccc7a7e27417bff9f05adf5932, 907fae80ddef53131f3292ee4f81644b All elements except , a4b561c25d9afb9ac8dc4d70affff419, 8e99a69fbe029cd4e2b854e244eab143, and 45a2772a6b6107b401db3c9b82c049c2 have animated transitions added.html *,
html *:before,
html *:after {
box-sizing: border-box;
-webkit-transition: 0.5s;
transition: 0.5s;
}
html i, html em,
html b, html strong,
html span {
-webkit-transition: none;
transition: none;
}
a {
text-decoration: none;
line-height: 80px;
color: black;
}
[class^="btn-"] {
position: relative;
display: block;
margin: 20px auto;
width: 100%;
height: 80px;
max-width: 250px;
text-transform: uppercase;
overflow: hidden;
border: 1px solid currentColor;
}
.btn-0 {
color: #9a3789;
}
.btn-0:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 0;
height: 80px;
background: #520c46;
}
.btn-0:hover {
color: #e1c4dc;
}
.btn-0:hover:before {
width: 250px;
}
.btn-0:active {
background: #881474;
}
The above is the detailed content of Detailed example of mouse over button special effects based on CSS3 animation. For more information, please follow other related articles on the PHP Chinese website!