找回密码
 免费注册

css3如何实现字体放大缩小变大变小动画效果

[复制链接]
发表于 2023-2-7 14:22:35 | 显示全部楼层 |阅读模式
css3如何实现字体放大缩小变大变小动画效果

css3代码如下:
  1.     <style type="text/css">
  2.         .play-button {
  3.             width: 300px;
  4.             height: 38px;
  5.             background: #0848F0;
  6.             border-radius: 4px;

  7.             margin-top: 10px;
  8.             margin-left: 10px;
  9.             text-align: center;
  10.         }

  11.         @keyframes scaleDraw {
  12.             /*定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称*/
  13.             0% {
  14.                 transform: scale(1);/*开始为原始大小*/
  15.             }
  16.             50% {
  17.                 transform: scale(1.2);/*放大1.1倍*/
  18.             }
  19.         }

  20.         .play-button-text {
  21.             width: 61px;
  22.             height: 38px;
  23.             font-size: 20px;
  24.             font-family: PingFangSC-Medium, PingFang SC;
  25.             font-weight: 500;
  26.             color: #FFFFFF;
  27.             line-height: 38px;
  28.             letter-spacing: 2px;
  29.             text-align: center;
  30.             display: inline-block;

  31.             -webkit-animation-name: scaleDraw;/*关键帧名称*/
  32.             -webkit-animation-timing-function: ease-in-out;/*动画的速度曲线*/
  33.             -webkit-animation-iteration-count: infinite;/*动画播放的次数*/
  34.             -webkit-animation-duration:0.5s;/*动画所花费的时间*/
  35.         }
  36.     </style>
复制代码
html代码如下:
  1. <div class="play-button"><div class="play-button-text">PLAY</div></div>
复制代码


QQ|Archiver|小黑屋|网站地图|深圳市金黑网络技术有限公司 ( 粤ICP备2021124338号|粤公网安备 44030702003689号 )

GMT+8, 2026-8-8 16:00 , Processed in 0.046617 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表