实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style>
5
#div1
6
{
7
position: relative;
8
height: 200px;
9
width: 200px;
10
margin: 100px;
11
padding:10px;
12
border: 1px solid black;
13
}
14
15
#div2
16
{
17
padding:50px;
18
position: absolute;
19
border: 1px solid black;
20
background-color: red;
21
transform: rotate(45deg);
22
transform-origin:20% 40%;
23
-ms-transform: rotate(45deg); /* IE 9 */
24
-ms-transform-origin:20% 40%; /* IE 9 */
25
-webkit-transform: rotate(45deg); /* Safari and Chrome */
26
-webkit-transform-origin:20% 40%; /* Safari and Chrome */
27
}
28
</style>
29
</head>
30
31
<body>
32
33
<div id="div1">
34
  <div id="div2">HELLO</div>
35
</div>
36
37
</body>
38
</html>
39