页面布局中的模块内容有良多是带有按钮的,比方是领会更多的按钮、表单提交的按钮等。按钮有指导用户点击、激起用户点击行为等的感化,
营销型网页设计公司,例以下单购置商品或跳转链接或睁开更多内容以达到领会更多的概略的目标。与页面气势派头和谐的按钮假想能够增长页面的美妙结果和更易于吸收客户的注意力,为了前进用户对关于页面操纵的体验度,还能够在按钮的制造中插手一些静态结果。譬喻,当鼠标经由按钮的时辰,能够妥当增加一些静态结果或插手后台的添补,下面是能够在平常事情中需要用css3制造鼠标经由页面按钮能用到的动画结果。
以下图按钮结果一,鼠标经由会有微微下陷的结果:
Html:
CSS:
.i-title .btn{
text-align: center;
margin-top: 50px;
}
.i-title .btn a{
background: none;
border: none;
display: inline-block;
text-align: center;
font-size: 14px;
color: #FFFFFF;
position: relative;
padding: 17px 35px;
overflow: hidden;
font-weight: 400;
cursor: pointer;
-moz-transition: all 400ms ease-in-out;
-o-transition: all 400ms ease-in-out;
-webkit-transition: all 400ms ease-in-out;
transition: all 400ms ease-in-out;
}
.i-title .btn a:before{
content: "";
position: absolute;
z-index: 50;
-moz-transition: all 1.4s ease;
-o-transition: all 1.4s ease;
-webkit-transition: all 1.4s ease;
transition: all 1.4s ease;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(27,57,82,0.3);
-moz-transform: scale(1.02, 1.02);
-ms-transform: scale(1.02, 1.02);
-webkit-transform: scale(1.02, 1.02);
transform: scale(1.02, 1.02);
-moz-transition: all 400ms ease-in-out;
-o-transition: all 400ms ease-in-out;
-webkit-transition: all 400ms ease-in-out;
transition: all 400ms ease-in-out;
}
.i-title .btn a:after{
content: "";
display: block;
position: absolute;
top: 2px;
left: 2px;
right: 2px;
bottom: 2px;
background-color: #1b3952;
z-index: 100;
-moz-transition: all 400ms ease-in-out;
-o-transition: all 400ms ease-in-out;
-webkit-transition: all 400ms ease-in-out;
transition: all 400ms ease-in-out;
}
.i-title .btn a span{
position: relative;
z-index: 300;
-moz-transition: all 400ms ease-in-out;
-o-transition: all 400ms ease-in-out;
-webkit-transition: all 400ms ease-in-out;
transition: all 400ms ease-in-out;
padding-right: 30px;
background: url(../images/img16.png) center right no-repeat;
}
.i-title .btn a:hover span{
background: url(../images/img17.png) center right no-repeat;
-moz-transition: all 400ms ease-in-out;
-o-transition: all 400ms ease-in-out;
-webkit-transition: all 400ms ease-in-out;
transition: all 400ms ease-in-out;
}
以下图按钮结果二,鼠标经由会有后台添补的动画结果:
Html:
Css:
.xbtn a{
position: relative;
display: block;
margin: 20px auto;
text-align: center;
width: 150px;
height: 50px;
line-height: 50px;
max-width: 250px;
color: #FFFFFF;
text-transform: uppercase;
overflow: hidden;
border: 1px solid currentColor;
}
.xbtn a:hover{
color: #1b3952;
}
.xbtn a span{
position: absolute;
display: block;
width: 0;
height: 0;
border-radius: 50%;
background: #FFFFFF;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transition: width 0.4s, height 0.4s;
transition: width 0.4s, height 0.4s;
z-index: -1;
}
.xbtn a:hover span {
width: 320px;
height: 320px;
}