-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08-box-model.html
89 lines (83 loc) · 2.14 KB
/
08-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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CSS Property 8 - Box Model</title>
<style>
body {
background-color: antiquewhite;
}
h1 {
color: brown;
}
h2,
h3 {
color: green;
}
hr {
height: 5px;
background-color: black;
border-radius: 10px;
}
.padding p {
color: sienna;
font-size: 20px;
}
.margin p {
color: teal;
font-size: 20px;
}
</style>
</head>
<body>
<h1>Box Model</h1>
<div class="padding">
<h2>Padding</h2>
<p style="padding: 30px; border: 2px solid red; text-align: center">
Padding Method 1 : One Value - 30px (Top, Right, Bottom and Left)
</p>
<p
style="padding: 40px 100px; border: 2px solid green; text-align: center"
>
Padding Method 2 : Two Values - 40px 100px [Vertical Padding (Top
Bottom) and Horizontal Padding (Right Left)]
</p>
<p
style="
padding: 10px 20px 30px 40px;
border: 2px solid blue;
text-align: center;
"
>
Padding Method 3 : Four Values - 10px 20px 30px 40px (Top, Right, Bottom
and Left)
</p>
</div>
<hr />
<div class="margin">
<h2>Margin</h2>
<p style="margin: 30px; border: 2px solid red; text-align: center">
Margin Method 1 : One Value - 30px (Top, Right, Bottom and Left)
</p>
<p
style="margin: 40px 100px; border: 2px solid green; text-align: center"
>
Margin Method 2 : Two Values - 40px 100px [Vertical Padding (Top Bottom)
and Horizontal Padding (Right Left)]
</p>
<p
style="
margin: 10px 20px 30px 40px;
border: 2px solid blue;
text-align: center;
"
>
Margin Method 3 : Four Values - 10px 20px 30px 40px (Top, Right, Bottom
and Left)
</p>
</div>
<hr />
</body>
</html>