赞
踩
CSS八种hover效果,快用起来_哔哩哔哩_bilibili
以下由于引入了transition所以还需要加兼容性处理:
-ms- :/* IE 9 */
-webkit- :/* Safari 和 Chrome */
-moz- :/* Firefox */
-o- :/* Opera */
-
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- .btn1{
- width: 100px;
- height: 40px;
- color: #fff;
- font-size: 20px;
- position: relative;
- background-color: skyblue;
- border: skyblue;
- border-radius: 5px;
- text-align: right;
- padding-right: 20px;
- }
- .btn1:hover img{
- animation: fly 2s ease 1;
- }
- @keyframes fly {
- 0%{
- transform: translateX(0);
- }
- 50%{
- transform: translateX(100px);
- }
- 100%{
- transform: translateX(0);
- }
- }
- .btn1 img{
- width: 20px;
- position: absolute;
- top: 10px;
- left: 10px;

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。