-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07_triangle.html
More file actions
77 lines (77 loc) · 1.62 KB
/
07_triangle.html
File metadata and controls
77 lines (77 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>DIV+CSS画三角形</title>
<style>
*{
padding: 0;
margin: 0;
}
.tree{
position: relative;
}
.tree div{
position: absolute;
width: 0;
height: 0;
}
.tree .wood{
width: 20px;
height: 50px;
background-color:gray;
left: 50%;
margin-left: -10px;
top: 170px;}
.a1{
border-right: 40px solid green;
border-top: 40px solid #fff;
left: 50%;
margin-left: -40px;
top: 0;
}
.a2{
border-left: 40px solid green;
border-top: 40px solid #fff;
left: 50%; top: 0;
}
.b1{
border-right: 70px solid green;
border-top: 70px solid #fff;
left: 50%;
margin-left: -70px;
top: 20px;
}
.b2{
border-left: 70px solid green;
border-top: 70px solid #fff;
left: 50%;
top: 20px;
}
.c1{
border-right: 100px solid green;
border-top: 100px solid #fff;
left: 50%;
margin-left: -100px;
top: 70px;
}
.c2{
border-left: 100px solid green;
border-top: 100px solid #fff;
left: 50%;
top: 70px;
}
</style>
</head>
<body>
<div class="tree">
<div class="wood"></div>
<div class=c1></div>
<div class=c2></div>
<div class=b1></div>
<div class=b2></div>
<div class="a1"></div>
<div class="a2"></div>
</div>
</body>
</html>