-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfloat-practice.html
134 lines (134 loc) · 2.5 KB
/
float-practice.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!--
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>float을 가상선택자 :after로 clear 하는 방법 예제</title>
<style type="text/css">
* {
margin: 0; padding:0; font-size:1em;
}
body {
background: #fff; margin:10px; font-size:.75em;
}
.header {
padding: 10px;
margin-bottom: 10px;
border: 2px solid #ccc;
}
.container::after {
content: "";
clear: both;
border: 2px solid #ccc;
background: #fff;
display: block;
}
.left {
float: left;
width: 40%;
padding: 10px;
border: 1px solid #181818;
background: yellowgreen;
}
.right {
float: right;
width: 40%;
padding: 10px;
border: 1px solid #181818;
background: yellowgreen;
}
.footer {
margin-top: 10px;
padding: 10px;
border: 2px solid #ccc;
background-color: blue;
}
</style>
</head>
<body>
<div class="header">
<p>header</p>
</div>
<div class="container">
<div class="left">
<p><strong>left </strong></p>
</div>
<div class="right">
<p><strong>right</strong></p>
</div>
</div>
<div class="footer">
<p>footer</p>
</div>
</body>
</html> -->
<!DOCTYPE html>
<html lang="kr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>absolute</title>
<style>
* {
margin: 0;
padding: 0;
font-size: 1em;
}
body {
background: #fff;
margin: 10px;
font-size: .75em;
}
.header {
padding: 10px;
margin-bottom: 10px;
border: 2px solid #ccc;
}
.container {
border: 2px solid #ccc;
}
.absolute1 {
/* position: absolute; */
float: left;
width: 500px;
padding: 10px;
border: 1px solid #181818;
background: yellowgreen;
}
.absolute2 {
/* position: absolute; */
float: left;
width: 400px;
padding: 10px;
border: 1px solid #181818;
background: blue;
}
.footer {
background: yellow;
margin-top: 10px;
padding: 10px;
border: 2px solid #ccc;
}
</style>
</head>
<body>
<div class="header">
<p>header</p>
</div>
<div class="container">
<div class="absolute1">
<p>
<strong>absolute1</strong>
</p>
</div>
<div class="absolute2">
<p>
<strong>absolute2</strong>
</p>
</div>
</div>
<div class="footer">
<p>footer</p>
</div>
</body>
</html>