CSS3制作3D文本悬停变化的特效代码
发布时间:2023-10-23 14:42:43 所属栏目:语言 来源:
导读:本文介绍了css3实现3D文本悬停改变效果的示例代码,分享给大家,具体如下:
html
<h1 class="hover-text-3d" data-text="w3cbest.com">W3CBEST.COM</h1>
css
.hover-text-3d {
font-size: 7
html
<h1 class="hover-text-3d" data-text="w3cbest.com">W3CBEST.COM</h1>
css
.hover-text-3d {
font-size: 7
本文介绍了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%; } (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐