-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththeboxmodel.html
More file actions
40 lines (31 loc) · 1.48 KB
/
theboxmodel.html
File metadata and controls
40 lines (31 loc) · 1.48 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Box Model</title>
<link rel="stylesheet" href="style5.css">
</head>
<body>
<h1>The Box Model</h1>
<p>In CSS, every element is represented as a rectangular box. The CSS box model describes the rectangular boxes that are generated for elements in the document tree and consists of: margins, borders, padding, and the actual content.</p>
<h2>Components of the Box Model</h2>
<ul>
<li><strong>Content:</strong> The innermost part where text and images appear.</li>
<li><strong>Padding:</strong> Space between the content and the border. It clears an area around the content.</li>
<li><strong>Border:</strong> A line surrounding the padding (if any) and content.</li>
<li><strong>Margin:</strong> The outermost space that separates the element from other elements.</li>
</ul>
<h2>Visual Representation</h2>
<div style="width: 200px; height: 100px; background-color: lightblue; padding: 20px; border: 5px solid blue; margin: 15px;">
This box illustrates the CSS Box Model.
</div>
<h4>In this example:</h4>
<ul>
<li>The content area is 200px wide and 100px high.</li>
<li>The padding is 20px on all sides.</li>
<li>The border is 5px thick and blue in color.</li>
<li>The margin is 15px on all sides.</li>
</ul>
</body>
</html>