Skip to content

Commit 57f02e2

Browse files
committed
Added margins and paddings to the elements. Added global reset of margins and paddings, using the universal selector in css.
1 parent 75262a5 commit 57f02e2

File tree

2 files changed

+47
-23
lines changed

2 files changed

+47
-23
lines changed

starter/03-CSS-Fundamentals/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h1>📘 The Code Magazine</h1>
2929
</header>
3030

3131
<article>
32-
<header>
32+
<header class="post-header">
3333
<h2>The Basic Language of the Web: HTML</h2>
3434

3535
<img

starter/03-CSS-Fundamentals/style.css

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
* {
22
/* border-top: 10px solid #1098ad; */
3+
margin: 0;
4+
padding: 0;
35
}
46

57
/* Inheritance example */
@@ -9,6 +11,35 @@ body {
911
border-top: 10px solid #1098ad;
1012
}
1113

14+
.main-header {
15+
background-color: #f7f7f7;
16+
/* padding: 20px;
17+
padding-left: 40px;
18+
padding-right: 40px; */
19+
padding: 20px 40px;
20+
margin-bottom: 60px;
21+
}
22+
23+
/* Inheritance example */
24+
nav {
25+
font-size: 18px;
26+
}
27+
28+
.post-header {
29+
margin-bottom: 40px;
30+
}
31+
32+
article {
33+
margin-bottom: 60px;
34+
}
35+
36+
aside {
37+
background-color: #f7f7f7;
38+
border-top: 5px solid #1098ad;
39+
border-bottom: 5px solid #1098ad;
40+
padding: 50px 0;
41+
}
42+
1243
h1,
1344
h2,
1445
h3 {
@@ -23,30 +54,40 @@ h1 {
2354

2455
h2 {
2556
font-size: 40px;
26-
font-family: sans-serif;
57+
margin-bottom: 30px;
2758
}
2859

2960
h3 {
3061
font-size: 30px;
31-
font-family: sans-serif;
62+
margin-bottom: 20px;
63+
margin-top: 40px;
3264
}
3365

3466
h4 {
3567
font-size: 20px;
36-
font-family: sans-serif;
3768
text-transform: uppercase;
3869
text-align: center;
3970
}
4071

4172
p {
4273
font-size: 22px;
43-
font-family: sans-serif;
4474
line-height: 1.5;
75+
margin-bottom: 15px;
76+
}
77+
78+
ul,
79+
ol {
80+
margin-left: 50px;
81+
margin-bottom: 20px;
4582
}
4683

4784
li {
48-
font-family: sans-serif;
4985
font-size: 20px;
86+
margin-bottom: 10px;
87+
}
88+
89+
li:last-child {
90+
margin-bottom: 0;
5091
}
5192

5293
/* css descendants are actually a bad practice */
@@ -77,18 +118,6 @@ li {
77118
list-style: none;
78119
}
79120

80-
.main-header {
81-
background-color: #f7f7f7;
82-
/* background-color: #444; */
83-
}
84-
85-
aside {
86-
background-color: #f7f7f7;
87-
/* background-color: #444; */
88-
border-top: 5px solid #1098ad;
89-
border-bottom: 5px solid #1098ad;
90-
}
91-
92121
/* body {
93122
background-color: azure;
94123
}
@@ -166,8 +195,3 @@ footer p {
166195
/* color: blue !important; << NOT A GOOD PRACTICE */
167196
color: blue;
168197
}
169-
170-
/* Inheritance example */
171-
nav {
172-
font-size: 18px;
173-
}

0 commit comments

Comments
 (0)