頁(yè)面布局中的模塊內(nèi)容有不少是帶有按鈕的,譬如是了解更多的按鈕、表單提交的按鈕等。按鈕有引導(dǎo)用戶點(diǎn)擊、激發(fā)用戶點(diǎn)擊行為等的作用,例如下單購(gòu)買商品或者跳轉(zhuǎn)鏈接或者展開更多內(nèi)容以達(dá)到了解更多的詳情的目的。與頁(yè)面風(fēng)格協(xié)調(diào)的按鈕設(shè)計(jì)可以增加頁(yè)面的美觀效果和更易于吸引客戶的注意力,為了提高用戶對(duì)關(guān)于頁(yè)面操作的體驗(yàn)度,還可以在按鈕的制作中加入一些動(dòng)態(tài)效果。例如,當(dāng)鼠標(biāo)經(jīng)過(guò)按鈕的時(shí)候,可以適當(dāng)添加一些動(dòng)態(tài)效果或者加入背景的填充,下面是可以在日常工作中需要用css3制作鼠標(biāo)經(jīng)過(guò)頁(yè)面按鈕能用到的動(dòng)畫效果。
如下圖按鈕效果一,鼠標(biāo)經(jīng)過(guò)會(huì)有微微下陷的效果:
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;
}
如下圖按鈕效果二,鼠標(biāo)經(jīng)過(guò)會(huì)有背景填充的動(dòng)畫效果:
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;
當(dāng)前題目:前端制作中鼠標(biāo)經(jīng)過(guò)按鈕的效果總結(jié)
分享地址:http://www.rwnh.cn/news/235571.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、品牌網(wǎng)站制作、網(wǎng)站制作、用戶體驗(yàn)、網(wǎng)站設(shè)計(jì)、移動(dòng)網(wǎng)站建設(shè)
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源:
創(chuàng)新互聯(lián)