-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2. Box Model.html
More file actions
53 lines (42 loc) · 1.39 KB
/
2. Box Model.html
File metadata and controls
53 lines (42 loc) · 1.39 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
<!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>Box Model</title>
<style>
*{
font-family: sans-serif;
}
.borderbox{
box-sizing: border-box ;
padding:20px 20px 20px 20px ;
border: 10px solid red ;
margin: 20px 20px ;
width: 400px;
}
.contentbox{
box-sizing: content-box;
padding:20px 20px 20px 20px ;
border: 10px solid red ;
margin: 20px 20px ;
width: 400px;
}
</style>
</head>
<body>
<div>
<main>
<h1>CSS Box Model :-</h1>
<p>In CSS, the term "box model" is used when talking about design and layout.</p>
<p>The CSS box model is essentially a box that wraps around every HTML element.
It consists of: `margins, borders, padding, and the actual content`. </p>
</main>
</div>
<h2>Border-Box Vs Content-Box</h2>
<div class="borderbox"> This is Border-Box, The width and height properties (and min/max properties) includes content, padding and border. </div>
<div class="contentbox"> This is the content-box, Default. The width and height properties (and min/max properties) includes only the content. Border and padding are not included
.</div>
</body>
</html>