html设计好看的按钮,2款创意CSS3按钮设计效果这是两款使⽤CSS3制作的炫酷按钮效果。这两款按钮的创意⼗分奇特,它们在⿏标滑过时均带有⼀定的动画效果。
使⽤⽅法
HTML结构
这两款按钮的⽰例代码均使⽤bootstrap来进⾏布局。按钮的HTML结构如下:
CSS样式
第⼀种按钮的CSS样式如下:
.btn{
border: 2px solid transparent;
border-radius: 0;
text-transform: uppercase;
position: relative;
transition: all 0.3s ease 0s;
}
.btn:before{
content: "";
height: 6px;
border-bottom: 2px solid transparent;
border-left: 2px solid transparent;
position: absolute;
bottom: -8px;
left: 4px;
right: -8px;
transition: all 0.3s ease 0s;
}
.btn.btn-sm:before{
height: 5px;
bottom: -7px;
left: 4px;
right: -6px;
}
.
btn:hover:before{
bottom: -2px;
left: -2px;
right: 2px;
border-color: #e16b47;
}
.btn:after{
content: "";
width: 6px;
border-right: 2px solid transparent; border-top: 2px solid transparent; position: absolute;
bottom: -8px;
right: -8px;
top: 4px;
transition: all 0.3s ease 0s;
}
.btn.btn-sm:after{
width: 5px;
bottom: -7px;
top: 2px;
right: -7px;
}
.btn:hover:after{
bottom: 2px;
right: -2px;
top: -2px;
border-color: #e16b47;
}
.d,
.d:before,
好看的css代码.d:after{
border-color: #ff6e6e;
color: #ff6e6e;
}
.
btn.blue,
.btn.blue:before,
.btn.blue:after{
border-color: #5cbcf6;
color: #5cbcf6;
}
.ange,
.ange:before,
.ange:after{
border-color: #ef965c;
color: #ef965c;
}
.,
.:before,
.:after{
border-color: #7ad79a;
color: #7ad79a;
}
@media only screen and (max-width: 767px){ .btn{ margin-bottom: 25px; }
}
第⼆种按钮的CSS样式如下:
.btn{
border: none;
border-radius: 5px;
color: #fff;
text-transform: uppercase;
padding-bottom: 15px;
position: relative;
background-image: linear-gradient(to top, #262626 0px, #404040 10px, #262626 10px, #333 100%);
}
.btn:hover{
color: #fff;
}
.btn:after{
content: "";
width: 0;
height: 10px;
position: absolute;
bottom: 0;
left: 0;
border-radius: 0 0 5px 5px;
transition: all 0.35s ease 0s;
}
.btn:hover:after{
width: 100%;
}
.btn.btn-sm{
padding-bottom: 10px;
background-image: linear-gradient(to top, #262626 0px, #404040 8px, #262626 8px, #333 100%);
}
.btn.btn-sm:after{
height: 8px;
}
.btn.btn-xs{
padding-bottom: 8px;
background-image: linear-gradient(to top, #262626 0px, #404040 6px, #262626 6px, #333 100%);
}
.btn.btn-xs:after{
height: 6px;
}
.d:after{
background: #ff6e6e;
}
.btn.blue:after{
background: #5cbcf6;
}
.ange:after{
background: #ef965c;
}
.:after{
background: #7ad79a;
}
@media only screen and (max-width: 767px){ .btn{ margin-bottom: 20px; }
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论