使用 CSS 沿 x 轴变换元素

cssweb developmentfront end technology更新于 2024/3/15 6:04:17

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

查看语法

translateX(n)

其中,n 是表示平移向量横坐标的长度。

查看示例

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

相关文章


有用资源