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