-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdivlayout.html
More file actions
69 lines (64 loc) · 1.04 KB
/
divlayout.html
File metadata and controls
69 lines (64 loc) · 1.04 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>div布局</title>
<style>
#container {
width: 800px;
height: 500px;
border: solid 1px #000000;
position: relative;
}
#d1 {
width: 100px;
height: 100px;
background: #0000FF;
position: absolute;
left: 0;
top: 0;
}
#d2 {
width: 100px;
height: 100px;
background: #008000;
position: absolute;
right: 0;
top: 0;
}
#d3 {
width: 100px;
height: 100px;
background: #008080;
position: absolute;
left: 0;
bottom: 0;
}
#d4 {
width: 100px;
height: 100px;
background: #00FFFF;
position: absolute;
right: 0;
bottom: 0;
}
#d5 {
width: 100px;
height: 100px;
background: #333333;
position: absolute;
left: calc(50% - 50px);
top: calc(50% - 50px);
}
</style>
</head>
<body>
<div id="container">
<div id="d1"></div>
<div id="d2"></div>
<div id="d3"></div>
<div id="d4"></div>
<div id="d5"></div>
</div>
</body>
</html>