通过 CSS 字体属性进行动画展示


若要通过 CSS 在font属性上实现动画效果,可尝试运行以下代码

示例

实时演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         p {
            border: 2px solid black;
            width: 400px;
            height: 100px;
            animation: myanim 5s infinite;
         }
         @keyframes myanim {
            70% {
               font: 35px arial, sans-serif;
            }
         }
      </style>
   </head>
   <body>
      <p>This is demo text</p>
   </body>
</html>

更新于: 2020 年 6 月 25 日

142 次浏览

启动你的职业生涯

通过完成课程获得认证

开始学习
广告
© . All rights reserved.