对 CSS font-weight 属性执行动画

cssweb developmentfront end technology更新于 2024/8/28 17:48:17

要使用 CSS 对 font-weight 属性实现动画,您可以尝试运行以下代码

示例

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

相关文章


有用资源