-
Notifications
You must be signed in to change notification settings - Fork 0
/
06_box_model.html
63 lines (55 loc) · 1.59 KB
/
06_box_model.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Box Model / Margin & margin</title>
<style>
* {
margin: 0;
margin: 0;
box-sizing: border-box; /* border-box & padding-box, changes default box-model */
}
.box {
background-color: lightgrey;
border: black solid;
/* padding on all sides */
padding: 20px;
/* padding per side */
padding-top: 10px;
padding-right: 20px;
padding-bottom: 10px;
padding-left: 20px;
/* padding shorthand top right bottom left */
padding: 10px 20px 10px 20px;
/* padding shorthand top/bottom left/right */
padding: 10px 20px;
/* margin on all sides */
margin: 20px;
/* margin per side */
margin-top: 10px;
margin-right: 20px;
margin-bottom: 10px;
margin-left: 20px;
/* margin shorthand top right bottom left */
margin: 10px 20px 10px 20px;
/* margin shorthand top/bottom left/right */
margin: 10px 20px;
}
</style>
</head>
<body>
<div class="box">
<h3>Box One</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia ipsa ab corrupti
cupiditate quo alias.
</p>
</div>
<div class="box">
<h3>Box Two</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Officia ipsa ab corrupti
cupiditate quo alias.
</p>
</div>
</body>
</html>