-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest15.html
More file actions
91 lines (87 loc) · 2.36 KB
/
Copy pathtest15.html
File metadata and controls
91 lines (87 loc) · 2.36 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="kr">
<head>
<meta charset="UTF-8">
<title>Float 연습</title>
<style>
.parent1{
border: 5px solid red;
width: 600px;
/* height: 200px; */
overflow: hidden;
/* inline이나 inline-block 요소는 가운데 정렬을 text-align: center로 한다. */
text-align: center;
}
.child1{
background-color: gold;
width: 200px;
height: 200px;
display: inline-block;
/* margin: auto는 block 요소만 적용된다. */
/* margin: auto; */
}
.parent{
/* 자식요소에 공통적으로 들어가는 CSS는 부모태그에서 지정한다. */
width: 600px;
border: 2px solid blue;
}
.top{
background-color: rgba(128, 0, 128, 0.709);
height: 100px;
}
.left{
background-color: skyblue;
width: 200px;
height: 300px;
float: left;
}
.right{
background-color: aquamarine;
width: 400px;
height: 300px;
float: right;
}
.clear{
background-color: purple;
height: 100px;
/* clear: both는 float 상태의 왼쪽,오른쪽 속성을 해제하는 명령어 */
clear: both;
}
section{
border: 3px solid black;
width: 650px;
/* overflow: hidden; */
text-align: center;
}
article{
width: 200px;
height: 100px;
background-color: yellow;
/* float 속성은 단 1px도 틀리면 안됨 */
/* float: left;*/
display: inline-block;
border: 1px solid red;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="parent1">
<span class="child1">
</span>
</div>
<br>
<div class="parent">
<div class="top">float:none</div>
<div class="left">float:left</div>
<div class="right">float:right</div>
<div class="clear">float:both</div>
</div>
<br>
<section>
<article>article</article>
<article>article</article>
<article>article</article>
</section>
</body>
</html>