当前位置:主页 > 查看内容

css3实现3D文本悬停改变效果的示例代码

发布时间:2021-06-29 00:00| 位朋友查看

简介:本文介绍了css3实现3D文本悬停改变效果的示例代码,分享给大家,具体如下: html h1 class=hover-text-3d data-text=w3cbest.comW3CBEST.COM/h1 css .hover-text-3d { font-size: 7em;}.hover-text-3d { position: absolute; top: 50%; left: 50%; -webkit-t……

本文介绍了css3实现3D文本悬停改变效果的示例代码,分享给大家,具体如下:

html

<h1 class="hover-text-3d" data-text="w3cbest.com">W3CBEST.COM</h1>

css

.hover-text-3d {
    font-size: 7em;
}
.hover-text-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    -webkit-text-fill-color: #fff;
    text-fill-color: #fff;
}
.hover-text-3d:before {
    position: absolute;
    overflow: hidden;
    width: 0;
    content: attr(data-text);
    -webkit-transition: 2s;
    -o-transition: 2s;
    transition: 2s;
    -webkit-text-fill-color: #aaf0d1;
    text-fill-color: #aaf0d1;
    -webkit-text-stroke-width: 2px;
    text-stroke-width: 2px;
    -webkit-text-stroke-color: #aaf0d1;
    text-stroke-color: #aaf0d1;
    -webkit-filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, .8));
    -o-filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, .8));
    filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, .8));
}
.hover-text-3d:hover:before {
    width: 100%;
}

查看效果

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。


原文链接:https://m.jb51.net/css/655256.html
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:简单几步用纯CSS3实现3D翻转效果 下一篇:没有了

推荐图文


随机推荐