使用 CSS3 使用 x 轴变换元素

cssweb developmentfront end technology更新于 2024/3/24 8:44:17

使用 transformX(x) 方法使用 x 轴变换元素。

查看语法

translateX(x)

这里

  • x:表示平移向量横坐标的长度。

查看示例

div {
   width: 40px;
   height: 40px;
   background-color: black;
}
.trans {
   transform: translateX(20px);
   background-color: orange;
}

相关文章


有用资源