| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- .box{
- width: 200px;
- height: 200px;
- background-color: red;
- margin: 200px auto;
- text-align: center;
- line-height: 200px;
- color: #fff;
- font-size: 100px;
- font-weight: bold;
- /* rotate() 旋转变换 有一个参数 用于指定元素旋转的角度
- 正数顺时针旋转 负数逆时针旋转
- */
- /* transform: rotate(45deg); */
- /* 原点 transform-origin 用于指定元素旋转的中心点 */
- /* 默认值是元素的中心点 */
- /* transform-origin有两个值 分别是水平方向和垂直方向的原点 */
- /* 可以使用 top left right bottom 也可以使用百分比 、像素值 */
- /* 原点可以在元素外部 */
- transform-origin: center 500px;
- transform: rotate(45deg);
- }
- </style>
- </head>
- <body>
- <div class="box">
- 中
- </div>
- </body>
- </html>
|