十年網(wǎng)站開(kāi)發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶(hù) + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專(zhuān)業(yè)推廣+無(wú)憂(yōu)售后,網(wǎng)站問(wèn)題一站解決
本篇內(nèi)容主要講解“怎么用CSS3實(shí)現(xiàn)鼠標(biāo)經(jīng)過(guò)動(dòng)畫(huà)時(shí)圖片變大的特效”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“怎么用CSS3實(shí)現(xiàn)鼠標(biāo)經(jīng)過(guò)動(dòng)畫(huà)時(shí)圖片變大的特效”吧!

這是一款css3鼠標(biāo)經(jīng)過(guò)動(dòng)畫(huà)特效。在該特效中,當(dāng)鼠標(biāo)經(jīng)過(guò)圖片時(shí),圖片略微放大,底部遮罩層出現(xiàn),同時(shí)圖片的描述文字和鏈接會(huì)以動(dòng)畫(huà)的方式出現(xiàn)在遮罩層之上,非常炫酷。
示例中,我們使用Bootstrap布局,該css3鼠標(biāo)經(jīng)過(guò)動(dòng)畫(huà)特效的HTML結(jié)構(gòu)如下:
Williamson
Web Developer
然后通過(guò)下面的CSS樣式來(lái)實(shí)現(xiàn)該css3鼠標(biāo)經(jīng)過(guò)動(dòng)畫(huà)特效。
.box{ text-align: center; overflow: hidden; position: relative;}.box:before{ content: ""; width: 150%; height: 150%; position: absolute; top: 50%; left: 50%; background: radial-gradient(rgba(255,255,255,0.1) 15%, transparent 15%) 0 0, radial-gradient(rgba(255,255,255,0.1) 15%, transparent 15%) 16px 16px, radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px, radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 16px 17px; background-size: 32px 32px; background-color: rgba(0,0,0,0.5); opacity: 0; z-index: 1; transform: translate(-50%, -50%) scale(0); transition: all 0.56s ease 0s;}.box:hover:before{ opacity: 1; transform: translate(-50%, -50%) scale(1);}.box img{ width: 100%; height: auto; transition: all 0.3s ease 0s;}.box:hover img{ transform: scale(1.3); }.box .box-content{ width: 100%; position: absolute; bottom: 5px; left: 0; z-index: 1; transition: all 0.3s ease 0s;}.box .title{ font-size: 22px; font-weight: 600; color: #47ddc8; text-transform: uppercase; text-shadow: 0 0 2px #000; opacity: 0; margin: 0 0 5px 0; position: relative; transform: translateY(100%); transition: all 0.5s ease 0s;}.box:hover .title{ opacity: 1; transform: translateY(0);}.box .post{ display: block; font-size: 14px; font-style: italic; color: #fff; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; transform: translateX(-100%) rotateX(90deg); transition: all 0.5s ease 0s;}.box:hover .post{ transform: translateY(0) rotate(0); }.box .icon{ padding: 0; margin: 0; list-style: none; position: absolute; top: 50%; left: 50%; z-index: 1; transform: translate(-50%, -50%); transition: all 0.3s ease 0s;}.box .icon li{ display: inline-block; margin: 0 7px; transform: rotateX(90deg); transition: all 0.3s ease 0s;}.box .icon li:last-child{ transition-delay: 0.2s; }.box:hover .icon li{ transform: rotateX(0); }.box .icon li a{ display: block; width: 35px; height: 35px; line-height: 35px; border-radius: 5px; background: #fff; font-size: 17px; color: #505050; transition: all 0.3s ease 0s;}.box .icon li a:hover{ background: #47ddc8; box-shadow: 0 0 10px #000; color: #fff;}@media only screen and (max-width:990px){ .box{ margin-bottom: 30px; }}
到此,相信大家對(duì)“怎么用CSS3實(shí)現(xiàn)鼠標(biāo)經(jīng)過(guò)動(dòng)畫(huà)時(shí)圖片變大的特效”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)建站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢(xún),關(guān)注我們,繼續(xù)學(xué)習(xí)!