首页
CSS
CSS 2D 变换
尝试:rotate() 方法
运行 ❯
获取您自己的网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <head> <style> div { width: 300px; height: 100px; background-color: yellow; border: 1px solid black; } div#myDiv { transform: rotate(-20deg); } </style> </head> <body> <h1>The rotate() Method</h1> <p>The rotate() method rotates an element clockwise or counter-clockwise.</p> <div> This a normal div element. </div> <div id="myDiv"> This div element is rotated counter-clockwise with 20 degrees. </div> </body> </html>