![](https://img.haomeiwen.com/i7275569/740c8a9137671b95.jpg)
基于【CSS】按钮特效的方法,做多几个不同角度的按钮~
![](https://img.haomeiwen.com/i7275569/2303b91a10181f8e.gif)
HTML代码
<a href="#">RABBIT</a>
CSS代码
body {
background: #353535;
}
a {
width: 200px;
display: block;
position: relative;
border: 2px solid #D24D57;
margin: 40px auto;
padding: 14px 16px;
font-size: 20px;
color: #fff;
text-align: center;
text-decoration: none;
overflow: hidden;
}
a:after {
content: '';
display: block;
position: absolute;
width: 100%;
height: 0%;
left: 50%;
top: 50%;
z-index: -1;
background: #D24D57;
transform: translateX(-50%) translateY(-50%) rotate(25deg);
-webkit-transition: all 0.75s ease 0s;
-moz-transition: all 0.75s ease 0s;
-o-transition: all 0.75s ease 0s;
transition: all 0.75s ease 0s;
}
a:hover:after {
height: 300%;
}
![](https://img.haomeiwen.com/i7275569/b13a9e16d996939e.gif)
HTML代码
<a href="#">RABBIT</a>
CSS代码
body {
background: #353535;
}
a {
width: 200px;
display: block;
position: relative;
border: 2px solid #D24D57;
margin: 40px auto;
padding: 14px 16px;
font-size: 20px;
color: #fff;
text-align: center;
text-decoration: none;
overflow: hidden;
}
a:after {
content: '';
display: block;
position: absolute;
opacity: 0;
width: 100%;
height: 0%;
left: 50%;
top: 50%;
z-index: -1;
background: #D24D57;
transform: translateX(-50%) translateY(-50%) rotate(0deg);
-webkit-transition: all 0.75s ease 0s;
-moz-transition: all 0.75s ease 0s;
-o-transition: all 0.75s ease 0s;
transition: all 0.75s ease 0s;
}
a:hover:after {
height: 300%;
opacity: 1;
}
![](https://img.haomeiwen.com/i7275569/356de977c11d0b06.gif)
HTML代码
<a href="#">RABBIT</a>
CSS代码
body {
background: #353535;
}
a {
width: 200px;
display: block;
position: relative;
border: 2px solid #D24D57;
margin: 40px auto;
padding: 14px 16px;
font-size: 20px;
color: #fff;
text-align: center;
text-decoration: none;
overflow: hidden;
}
a:after {
content: '';
display: block;
position: absolute;
opacity: 0;
width: 100%;
height: 0%;
left: 50%;
top: 50%;
z-index: -1;
background: #D24D57;
transform: translateX(-50%) translateY(-50%) rotate(90deg);
-webkit-transition: all 0.75s ease 0s;
-moz-transition: all 0.75s ease 0s;
-o-transition: all 0.75s ease 0s;
transition: all 0.75s ease 0s;
}
a:hover:after {
height: 450%;
opacity: 1;
}
HTML与CSS 目录:HTML与CSS
上一篇:【CSS】按钮特效
下一篇:【CSS】按钮特效 - 3
网友评论