CSS 中 transform 属性的用法

cssweb developmentfront end technology更新于 2024/7/24 12:28:17

CSS 中的 transform 属性用于对元素应用 2D 或 3D 变换。您可以尝试运行以下代码来实现 transform 属性 −

示例

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 200px;
            height: 100px;
            background-color: gray;
            transform: rotate(10deg);
         }
      </style>
   </head>
   <body>
      <h1>Rotation</h1>
      <div>Demo</div>
   </body>
</html>

相关文章


有用资源