html语言鼠标悬停特效,CSS3鼠标悬停文字幻影动画特效
這是一款CSS3鼠標懸停文字幻影動畫特效。該特效利用before和after偽元素來制作當鼠標懸停在超鏈接文本上的時候的幻影效果。
使用方法
在頁面中引入bootstrap.css、jquery和photoviewer.js文件。
HTML結構
在頁面中添加一個元素,并設置它的data-hover屬性和它的顯示文字相同。
鼠標移過來
CSS樣式
然后通過下面的CSS樣式來制作鼠標懸停在超鏈接文字上的幻影動畫特效。
.link{
color: #555;
font-family: 'Courgette', cursive;
font-size: 30px;
line-height: 25px;
display: inline-block;
position: relative;
z-index: 1;
transition: all 0.5s;
}
.link:hover{ color: transparent; }
.link:before,
.link:after{
content: attr(data-hover);
white-space: nowrap;
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
transition:all 0.5s;
}
.link:after{
color: #1da493;
opacity: 0;
left: -10px;
}
.link:hover:before{
left: 15px;
opacity: 0;
}
.link:hover:after{
left: 0;
opacity: 1;
transition-delay:0.1s;
}
@media only screen and (max-width: 990px){
.link span{ font-size: 20px; }
}
@media only screen and (max-width: 767px){
.link{ margin: 0 0 30px; }
}
總結
以上是生活随笔為你收集整理的html语言鼠标悬停特效,CSS3鼠标悬停文字幻影动画特效的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java加密与解密的艺术~数字签名~DS
- 下一篇: teamviewer企业版 添加计算机,