Skip to content

Commit ab51886

Browse files
committed
Section 5
1 parent 10de6bc commit ab51886

File tree

13 files changed

+427
-54
lines changed

13 files changed

+427
-54
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": true
3+
}

starter/04-CSS-Layouts/css-grid.html

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
}
1212
.el--2 {
1313
background-color: orangered;
14+
/* grid-column: 1 / span 4; */
15+
/* grid-column: 1 / -1; */
16+
grid-row: 2;
1417
}
1518
.el--3 {
1619
background-color: green;
@@ -30,6 +33,8 @@
3033
}
3134
.el--8 {
3235
background-color: crimson;
36+
grid-column: 2 / 3;
37+
grid-row: 1 / 3;
3338
}
3439

3540
.container--1 {
@@ -40,19 +45,48 @@
4045
margin: 40px;
4146

4247
/* CSS GRID */
48+
display: grid;
49+
/* grid-template-columns: 3fr 1fr 1fr 1fr; */
50+
/* grid-template-rows: 1fr 1fr; */
51+
grid-template-columns: repeat(4, 1fr);
52+
grid-template-rows: 1fr 1fr;
53+
/* height: 500px; */
54+
55+
column-gap: 10px;
56+
row-gap: 40px;
57+
58+
/* TEMP */
59+
display: none;
4360
}
4461

4562
.container--2 {
4663
/* STARTER */
4764
font-family: sans-serif;
4865
background-color: black;
4966
font-size: 40px;
50-
margin: 100px;
67+
margin: 40px;
5168

52-
width: 1000px;
69+
width: 700px;
5370
height: 600px;
5471

5572
/* CSS GRID */
73+
display: grid;
74+
grid-template-columns: 125px 200px 125px;
75+
grid-template-rows: 250px 100px;
76+
gap: 20px;
77+
78+
/* Aligning tracks inside container: distribute empty space*/
79+
justify-content: center;
80+
align-content: center;
81+
82+
/* Aligning items inside cells: move items around inside cells */
83+
align-items: center;
84+
justify-items: center;
85+
}
86+
87+
.el--3 {
88+
align-self: end;
89+
justify-self: end;
5690
}
5791
</style>
5892
</head>
@@ -64,7 +98,7 @@
6498
<div class="el el--4">(4) are</div>
6599
<div class="el el--5">(5) amazing</div>
66100
<div class="el el--6">(6) languages</div>
67-
<div class="el el--7">(7) to</div>
101+
<!-- <div class="el el--7">(7) to</div> -->
68102
<div class="el el--8">(8) learn</div>
69103
</div>
70104

starter/04-CSS-Layouts/index.html

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ <h1>📘 The Code Magazine</h1>
3434
<header class="post-header">
3535
<h2>The Basic Language of the Web: HTML</h2>
3636

37-
<img
38-
src="img/laura-jones.jpg"
39-
alt="Headshot of Laura Jones"
40-
height="50"
41-
width="50"
42-
/>
37+
<div class="author-box">
38+
<img
39+
src="img/laura-jones.jpg"
40+
alt="Headshot of Laura Jones"
41+
height="50"
42+
width="50"
43+
/>
4344

44-
<p id="author">
45-
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
46-
</p>
45+
<p id="author" class="author">
46+
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
47+
</p>
48+
</div>
4749

4850
<img
4951
src="img/post-img.jpg"
@@ -123,25 +125,29 @@ <h3>Why should you learn HTML?</h3>
123125
<h4>Related posts</h4>
124126

125127
<ul class="related">
126-
<li>
128+
<li class="related-post">
127129
<img
128130
src="img/related-1.jpg"
129131
alt="Person programming"
130132
width="75"
131133
height="75"
132134
/>
133-
<a href="#">How to Learn Web Development</a>
134-
<p class="related-author">By Jonas Schmedtmann</p>
135+
<div>
136+
<a href="#" class="related-link">How to Learn Web Development</a>
137+
<p class="related-author">By Jonas Schmedtmann</p>
138+
</div>
135139
</li>
136-
<li>
140+
<li class="related-post">
137141
<img
138142
src="img/related-2.jpg"
139143
alt="Lightning"
140144
width="75"
141145
height="75"
142146
/>
143-
<a href="#">The Unknown Powers of CSS</a>
144-
<p class="related-author">By Jim Dillon</p>
147+
<div>
148+
<a href="#" class="related-link">The Unknown Powers of CSS</a>
149+
<p class="related-author">By Jim Dillon</p>
150+
</div>
145151
</li>
146152
<li>
147153
<img

starter/04-CSS-Layouts/style.css

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body {
1414
}
1515

1616
.container {
17-
width: 800px;
17+
width: 1200px;
1818
/* margin-left: auto;
1919
margin-right: auto; */
2020
margin: 0 auto;
@@ -26,7 +26,6 @@ body {
2626
padding-left: 40px;
2727
padding-right: 40px; */
2828
padding: 20px 40px;
29-
margin-bottom: 60px;
3029
/* height: 80px; */
3130
}
3231

@@ -35,10 +34,6 @@ nav {
3534
/* text-align: center; */
3635
}
3736

38-
article {
39-
margin-bottom: 60px;
40-
}
41-
4237
.post-header {
4338
margin-bottom: 40px;
4439
/* position: relative; */
@@ -51,7 +46,21 @@ aside {
5146
/* padding-top: 50px;
5247
padding-bottom: 50px; */
5348
padding: 50px 0;
54-
width: 500px;
49+
}
50+
51+
.related-post {
52+
display: flex;
53+
align-items: center;
54+
gap: 20px;
55+
margin-bottom: 30px;
56+
}
57+
58+
.related-link {
59+
font-size: 17px;
60+
font-weight: bold;
61+
font-style: normal;
62+
margin-bottom: 5px;
63+
display: block;
5564
}
5665

5766
/* SMALLER ELEMENTS */
@@ -124,8 +133,10 @@ li:last-child {
124133
}
125134

126135
.related-author {
127-
font-size: 18px;
128-
font-weight: bold;
136+
margin-bottom: 0;
137+
font-size: 14px;
138+
font-weight: normal;
139+
font-style: italic;
129140
}
130141

131142
/* ul {
@@ -136,14 +147,6 @@ li:last-child {
136147
list-style: none;
137148
}
138149

139-
body {
140-
/* background-color: orangered; */
141-
}
142-
143-
/* .first-li {
144-
font-weight: bold;
145-
} */
146-
147150
li:first-child {
148151
font-weight: bold;
149152
}
@@ -197,7 +200,6 @@ nav a:link {
197200
display: block; */
198201

199202
margin-right: 30px;
200-
margin-top: 10px;
201203
display: inline-block;
202204
}
203205

@@ -222,10 +224,6 @@ h1::first-letter {
222224
margin-right: 5px;
223225
}
224226

225-
h3 + p::first-line {
226-
/* color: red; */
227-
}
228-
229227
h2 {
230228
/* background-color: orange; */
231229
position: relative;
@@ -265,3 +263,33 @@ footer p {
265263
nav p {
266264
font-size: 18px;
267265
} */
266+
267+
.author-box {
268+
display: flex;
269+
align-items: center;
270+
margin: 1rem 0;
271+
}
272+
273+
.author {
274+
margin-bottom: 0;
275+
margin-left: 15px;
276+
}
277+
278+
.container {
279+
display: grid;
280+
grid-template-columns: 1fr 300px;
281+
column-gap: 75px;
282+
row-gap: 60px;
283+
align-items: start;
284+
}
285+
286+
.main-header {
287+
grid-column: 1 / -1;
288+
display: flex;
289+
justify-content: space-between;
290+
align-items: center;
291+
}
292+
293+
footer {
294+
grid-column: 1 / -1;
295+
}

starter/05-Design/font/Inter-Bold.otf

265 KB
Binary file not shown.
272 KB
Binary file not shown.
265 KB
Binary file not shown.
263 KB
Binary file not shown.
272 KB
Binary file not shown.
253 KB
Binary file not shown.

starter/05-Design/font/Inter-V.ttf

787 KB
Binary file not shown.

0 commit comments

Comments
 (0)