Skip to content

Commit 859687e

Browse files
authored
Add files via upload
Week 3 Assignment - CSS Basics & The Box Model
1 parent c15495b commit 859687e

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

index.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>CSS Basics & The Box Model — Assignment</title>
7+
<link rel="stylesheet" href="styles.css">
8+
</head>
9+
<body>
10+
<header class="site-header container">
11+
<h1>CSS Basics & The Box Model</h1>
12+
<p class="lead">This page demonstrates fundamental CSS properties and how the Box Model works in practice.</p>
13+
</header>
14+
15+
<main class="container">
16+
<section class="card">
17+
<h2>Basic CSS Properties</h2>
18+
<p><span class="example color-example">This text shows the use of <code>color</code>.</span></p>
19+
<p><span class="example background-example">This box shows the use of <code>background</code>.</span></p>
20+
<p><span class="example font-example">This line shows <code>font-size</code> and <code>font-style</code>.</span></p>
21+
<p><span class="example border-example">This demonstrates <code>border</code> and <code>border-radius</code>.</span></p>
22+
<p><span class="example spacing-example">This box uses <code>margin</code> and <code>padding</code>.</span></p>
23+
</section>
24+
25+
<section class="card">
26+
<h2>Understanding the Box Model</h2>
27+
<p>Every element in CSS is a rectangular box consisting of:</p>
28+
<ul>
29+
<li><strong>Content</strong>: the text or image inside.</li>
30+
<li><strong>Padding</strong>: space between the content and the border.</li>
31+
<li><strong>Border</strong>: the edge of the element.</li>
32+
<li><strong>Margin</strong>: the space outside the border, separating elements.</li>
33+
</ul>
34+
35+
<div class="box-demo">
36+
<div class="content">Content</div>
37+
</div>
38+
</section>
39+
</main>
40+
41+
<footer class="site-footer">
42+
<p>&copy; 2025 Augusto Mate. All rights reserved.</p>
43+
</footer>
44+
</body>
45+
</html>

styles.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/* ==============================
2+
CSS Basics & Box Model (EN)
3+
Stylesheet for assignment
4+
============================== */
5+
6+
* { box-sizing: border-box; margin: 0; padding: 0; }
7+
body { font-family: Arial, sans-serif; background: #f4f4f4; color: #111; line-height: 1.5; }
8+
.container { max-width: 800px; margin: 0 auto; padding: 1rem; }
9+
10+
h1, h2 { margin-bottom: 1rem; }
11+
p, li { margin-bottom: 0.5rem; }
12+
ul { margin-left: 1.5rem; }
13+
14+
.card {
15+
background: #fff;
16+
border: 1px solid #ccc;
17+
border-radius: 8px;
18+
padding: 1.5rem;
19+
margin-bottom: 2rem;
20+
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
21+
}
22+
23+
/* Examples of CSS properties */
24+
.example { display: inline-block; padding: 0.5rem; margin: 0.5rem 0; }
25+
.color-example { color: darkred; }
26+
.background-example { background: lightblue; }
27+
.font-example { font-size: 1.25rem; font-style: italic; }
28+
.border-example { border: 2px solid green; border-radius: 6px; }
29+
.spacing-example { background: #eee; margin: 1rem; padding: 1rem; display: block; }
30+
31+
/* Box Model demo */
32+
.box-demo {
33+
background: lightcoral;
34+
padding: 20px; /* padding visible */
35+
border: 5px solid navy;/* border visible */
36+
margin: 15px; /* margin around */
37+
color: #fff;
38+
border-radius: 6px;
39+
}
40+
.box-demo .content {
41+
background: white;
42+
color: black;
43+
padding: 10px;
44+
text-align: center;
45+
}
46+
47+
.site-footer {
48+
text-align: center;
49+
font-size: 0.875rem;
50+
padding: 1rem;
51+
color: #555;
52+
}

0 commit comments

Comments
 (0)