首页
CSS
CSS 2D 变换
试用:translate() 方法
运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> div { width: 300px; height: 100px; background-color: yellow; border: 1px solid black; transform: translate(50px,100px); } </style> </head> <body> <h1>The translate() Method</h1> <p>The translate() method moves an element from its current position:</p> <div> This div element is moved 50 pixels to the right, and 100 pixels down from its current position. </div> </body> </html>