Skip to content

Commit abe1f96

Browse files
committed
Completed Using Margins and Paddings
1 parent c464e73 commit abe1f96

File tree

2 files changed

+66
-16
lines changed

2 files changed

+66
-16
lines changed

myWork/03-CSS-Fundamentals/index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<body>
1010
<header class="main-header">
11-
<h1>📘 The Code Magazine</h1>
11+
<h1 class="title-text">📘 The Code Magazine</h1>
1212

1313
<nav>
1414
<a href="blog.html" target="_blank">Blog</a>
@@ -18,11 +18,12 @@ <h1>📘 The Code Magazine</h1>
1818
</nav>
1919
</header>
2020

21-
<article>
21+
<article class="product-article">
2222
<header>
23-
<h2>The Basic Language of the Web: HTML</h2>
23+
<h2 class="article-header">The Basic Language of the Web: HTML</h2>
2424

2525
<img
26+
class="author-image"
2627
src="images/laura-jones.jpg"
2728
alt="Photo of Laura Jones"
2829
width="50"
@@ -33,6 +34,7 @@ <h2>The Basic Language of the Web: HTML</h2>
3334
</p>
3435

3536
<img
37+
class="article-image"
3638
src="images/post-img.jpg"
3739
alt="HTML code on a screen"
3840
width="500"
@@ -68,7 +70,7 @@ <h3>What is HTML?</h3>
6870

6971
<p>In HTML, each element is made up of 3 parts:</p>
7072

71-
<ol>
73+
<ol class="article-list">
7274
<li>The opening tag</li>
7375
<li>The closing tag</li>
7476
<li>The actual element</li>
@@ -90,7 +92,7 @@ <h3>Why should you learn HTML?</h3>
9092
web. Here are 5 of them:
9193
</p>
9294

93-
<ul>
95+
<ul class="article-list">
9496
<li>To be able to use the fundamental web dev language</li>
9597
<li>
9698
To hand-craft beautiful websites instead of relying on tools like

myWork/03-CSS-Fundamentals/style.css

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1+
* {
2+
margin: 0;
3+
padding: 0 3px;
4+
}
5+
16
body {
27
color: #444444;
38
font-family: sans-serif;
49
}
510

11+
.main-header {
12+
background-color: #f7f7f7;
13+
border-top: 5px solid #1098ad;
14+
padding: 10px 20px;
15+
margin-bottom: 15px;
16+
}
17+
18+
.related-aside {
19+
background-color: #f7f7f7;
20+
border-top: 5px solid #1098ad;
21+
border-bottom: 5px solid #1098ad;
22+
padding: 10px 0;
23+
}
24+
625
h1,
726
h2,
827
h3 {
928
color: #1098ad;
29+
margin-bottom: 10px;
1030
}
1131

1232
h1 {
@@ -17,10 +37,12 @@ h1 {
1737

1838
h2 {
1939
font-size: 40px;
40+
margin-bottom: 8px;
2041
}
2142

2243
h3 {
23-
font-size: 25px;
44+
font-size: 22px;
45+
margin-top: 30px;
2446
}
2547

2648
h4 {
@@ -32,15 +54,26 @@ h4 {
3254
p {
3355
font-size: 16px;
3456
line-height: 1.5;
57+
margin-bottom: 10px;
58+
}
59+
60+
.article-list {
61+
margin: 0 25px 5px 25px;
3562
}
3663

3764
li {
3865
font-size: 15px;
66+
margin-bottom: 10px;
67+
}
68+
69+
li:last-child {
70+
margin-bottom: 0;
3971
}
4072

4173
.author {
4274
font-style: italic;
4375
font-size: 14px;
76+
margin-bottom: 3px;
4477
}
4578

4679
.copyright {
@@ -56,16 +89,6 @@ li {
5689
list-style: none;
5790
}
5891

59-
.main-header {
60-
background-color: #f7f7f7;
61-
}
62-
63-
.related-aside {
64-
background-color: #f7f7f7;
65-
border-top: 5px solid #1098ad;
66-
border-bottom: 5px solid #1098ad;
67-
}
68-
6992
a:link {
7093
color: #1098ad;
7194
text-decoration: none;
@@ -85,3 +108,28 @@ a:active {
85108
background-color: black;
86109
font-style: italic;
87110
}
111+
112+
.title-text {
113+
margin-top: 5px;
114+
margin-bottom: 5px;
115+
}
116+
117+
.author-image {
118+
margin-bottom: 3px;
119+
}
120+
121+
.article-image {
122+
margin-bottom: 5px;
123+
}
124+
125+
strong {
126+
padding: 0;
127+
}
128+
129+
.article-header {
130+
font-size: 40px;
131+
}
132+
133+
.product-article {
134+
margin-bottom: 20px;
135+
}

0 commit comments

Comments
 (0)