html文字出现效果,CSS3实现的文字弹出特效

本文详细介绍了如何利用CSS3实现文字的弹出动画特效,包括背景渐变、字体样式设置以及关键帧动画的运用。示例代码展示了文字从无到有、从隐藏到显现的过程,适合前端开发者学习和参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

实现效果

20ee3b5d1dfd3dc828964c09c011d730.gif

实现代码

html

脚本之家

https://www.jb51.net

a css3 animation demo

css3

@import url('https://fonts.googleapis.com/css?family=Roboto:300');

body {

text-align:center;

background:linear-gradient(141deg, #ccc 25%, #eee 40%, #ddd 55%);

color:#555;

font-family:'Roboto';

font-weight:300;

font-size:32px;

padding-top:40vh;

height:100vh;

overflow:hidden;

-webkit-backface-visibility: hidden;

-webkit-perspective: 1000;

-webkit-transform: translate3d(0,0,0);

}

div {

display:inline-block;

overflow:hidden;

white-space:nowrap;

}

div:first-of-type { /* For increasing performance

ID/Class should've been used.

For a small demo

it's okaish for now */

animation: showup 7s infinite;

}

div:last-of-type {

width:0px;

animation: reveal 7s infinite;

}

div:last-of-type span {

margin-left:-355px;

animation: slidein 7s infinite;

}

@keyframes showup {

0% {opacity:0;}

20% {opacity:1;}

80% {opacity:1;}

100% {opacity:0;}

}

@keyframes slidein {

0% { margin-left:-800px; }

20% { margin-left:-800px; }

35% { margin-left:0px; }

100% { margin-left:0px; }

}

@keyframes reveal {

0% {opacity:0;width:0px;}

20% {opacity:1;width:0px;}

30% {width:355px;}

80% {opacity:1;}

100% {opacity:0;width:355px;}

}

p {

font-size:12px;

color:#999;

margin-top:200px;

}

以上就是CSS3实现的文字弹出特效的详细内容,更多关于CSS3 文字弹出特效的资料请关注脚本之家其它相关文章!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值