-
Notifications
You must be signed in to change notification settings - Fork 3
/
float.html
68 lines (68 loc) · 1.68 KB
/
float.html
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style>
.red {
border: 1px solid red;
}
.green {
border: 1px solid lime;
}
.yellow {
border: 1px solid gold;
}
div {
min-width: 100px;
min-height: 100px;
padding: 10px;
margin: 10px;
}
</style>
</head>
<body>
<h2>测试不同的高度</h2>
<div class="red" style="width: 700px">
<div class="green" style="width: 50%; display: inline-block">
</div>
<div class="yellow" style="float: right; width: 10%; height: 200px">
我是yellow的div
</div>
<div style="width: 100%; height: 100%;"></div>
<div style="clear: both; min-height: 0px"></div>
</div>
<div class="red">
<div class="green">
最普通
</div>
<div class="yellow">
最普通
</div>
</div>
<div class="red">
<div class="green" style="float: left">
float: left
</div>
<div class="yellow">
最普通
</div>
</div>
<div class="red">
<div class="green" style="float: left; height: 200px">
float: left, 我很高。但是因为我是float,所以无法撑开
</div>
<div class="yellow">
最普通
</div>
</div>
<div class="red" style="margin-top: 100px">
<div class="green" style="float: left;">
float: left, 我很高。但是因为我是float,所以无法撑开
</div>
<div class="yellow" style="height: 200px">
我很高,可以撑开高度
</div>
</div>
</body>
</html>