Skip to content

Commit abc6d3f

Browse files
committed
vid 34 done
1 parent 6dd07c5 commit abc6d3f

File tree

4 files changed

+61
-17
lines changed

4 files changed

+61
-17
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,23 @@ Use starter code to start each section, and **final code to compare it with your
6060

6161
**A:** No, for the simple reason that I want this repository to contain the _exact_ same code that is shown in the videos. However, please feel free to add an issue if you found one.
6262

63+
# Notes
64+
65+
## Box Model
66+
- content: the content of the html element, text, images, etc
67+
- padding: transparent area around the content, inside the border
68+
- border: goes around the padding and the content
69+
- margin: transparent area around the border, outside the border
70+
- we normally use margin to **create space between elements**
71+
- collapsing margin: when two margins touch each other, they collapse into one margin
72+
- the margin will be the size of the larger margin
73+
- this is a feature of CSS
74+
- it does not happen with padding or border
6375

6476
# Useful Links
6577
- https://jonas.io/resources/
6678
- W3C page for pseudo classes: https://www.w3schools.com/css/css_pseudo_classes.asp
6779
- the n-th child pseudo class: it selects the elements that are the n-th child of their parent and that match a certain type of selector
6880
- ex: 'artical p:first-child' does not select the first p element in the article element, but the p element that is the first child of a article element
6981
- it's perfect to apply to the child elements that are of the same type
82+
- https://www.youtube.com/watch?v=uFXweZepi1o&list=PLqivELodHt3iF_Spzdz_6LsOSPOyfDx-R

starter/03-CSS-Fundamentals/challange/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ body {
4646
.add-cart {
4747
background-color: black;
4848
border: none;
49+
margin-bottom: 1px;
4950
color: white;
5051
font-size: 20px;
5152
cursor: pointer;

starter/03-CSS-Fundamentals/index.html

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

3030
<article>
31-
<header>
31+
<header class="post-header">
3232
<h2>The Basic Language of the Web: HTML</h2>
3333

3434
<img

starter/03-CSS-Fundamentals/style.css

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
* {
22
/* universal selector; no inheritance involved */
33
/* border-bottom: 10px solid red; */
4+
margin: 0;
5+
padding: 0s;
46
}
57

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

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

2455
h2 {
2556
font-size: 40px;
57+
margin-bottom: 30px;
2658
}
2759

2860
h3 {
2961
font-size: 30px;
62+
margin-bottom: 20px;
63+
margin-top: 30px;
3064
}
3165

3266
h4 {
@@ -38,10 +72,22 @@ h4 {
3872
p {
3973
font-size: 22px;
4074
line-height: 1.5;
75+
margin-bottom: 15px;
76+
}
77+
78+
ol,
79+
ul {
80+
margin-left: 50px;
81+
margin-bottom: 20px;
4182
}
4283

4384
li {
4485
font-size: 20px;
86+
margin-bottom: 10px;
87+
}
88+
89+
li:last-child {
90+
margin-bottom: 0;
4591
}
4692

4793
/* footer p {
@@ -70,18 +116,6 @@ li {
70116
list-style: none;
71117
}
72118

73-
.main-header {
74-
background-color: #f7f7f7;
75-
}
76-
77-
aside {
78-
background-color: #f7f7f7;
79-
/* shorthand property */
80-
/* border: 5px solid #1098ad; */
81-
border-top: 5px solid #1098ad;
82-
border-bottom: 5px solid #1098ad;
83-
}
84-
85119
/* li:first-child {
86120
font-weight: bold;
87121
}
@@ -111,7 +145,3 @@ a:active {
111145
font-style: italic;
112146
}
113147
/* LVHA */
114-
115-
nav {
116-
font-size: 18px;
117-
}

0 commit comments

Comments
 (0)