Skip to content

Commit ee6901c

Browse files
committed
Added: Up to 4.56 "Adding Flexbox to Our Project"
1 parent 4de963d commit ee6901c

File tree

3 files changed

+106
-31
lines changed

3 files changed

+106
-31
lines changed

ongoing/04-CSS-Layouts/flexbox.html

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,43 @@
3636
/* STARTER */
3737
font-family: sans-serif;
3838
background-color: #ddd;
39-
font-size: 40px;
39+
font-size: 32px;
4040
margin: 40px;
4141

4242
/* FLEXBOX */
43+
display: flex;
44+
align-items: center;
45+
justify-content: flex-start;
46+
gap: 30px;
47+
}
48+
49+
.el {
50+
/* DEFAULTS:
51+
flex-grow: 0;
52+
flex-shrink: 1;
53+
flex-basis: auto; */
54+
55+
/* flex-basis: 200px;
56+
flex-shrink: 0; */
57+
flex: 0 0 200px;
58+
/* flex-grow: 1; */
59+
60+
/* flex: 1; */
61+
}
62+
63+
.el--1 {
64+
align-self: flex-start;
65+
/* order: 2; */
66+
/* flex-grow: 2; */
67+
}
68+
69+
.el--5 {
70+
align-self: stretch;
71+
order: 1;
72+
}
73+
74+
.el--6 {
75+
order: -1;
4376
}
4477
</style>
4578
</head>
@@ -50,9 +83,9 @@
5083
<div class="el el--3">CSS</div>
5184
<div class="el el--4">are</div>
5285
<div class="el el--5">amazing</div>
53-
<div class="el el--6">languages</div>
54-
<div class="el el--7">to</div>
55-
<div class="el el--8">learn</div>
86+
<!-- <div class="el el--6">languages</div> -->
87+
<!-- <div class="el el--7">to</div>
88+
<div class="el el--8">learn</div> -->
5689
</div>
5790
</body>
5891
</html>

ongoing/04-CSS-Layouts/index.html

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ <h1>📘 The Code Magazine</h1>
2525
<!-- <strong>This is the navigation</strong> -->
2626
<a href="blog.html">Blog</a>
2727
<a href="#">Challenges</a>
28-
<a href="#">Flexbox</a>
29-
<a href="#">CSS Grid</a>
28+
<a href="flexbox.html">Flexbox</a>
29+
<a href="css-grid.html">CSS Grid</a>
3030
</nav>
3131

3232
<!-- <div class="clear"></div> -->
@@ -36,17 +36,19 @@ <h1>📘 The Code Magazine</h1>
3636
<header class="post-header">
3737
<h2>The Basic Language of the Web: HTML</h2>
3838

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

47-
<p id="author" class="author">
48-
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
49-
</p>
48+
<p id="author" class="author">
49+
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
50+
</p>
51+
</div>
5052

5153
<img
5254
src="img/post-img.jpg"
@@ -126,35 +128,41 @@ <h3>Why should you learn HTML?</h3>
126128
<h4>Related posts</h4>
127129

128130
<ul class="related">
129-
<li>
131+
<li class="related-post">
130132
<img
131133
src="img/related-1.jpg"
132134
alt="Person programming"
133135
width="75"
134136
height="75"
135137
/>
136-
<a href="#">How to Learn Web Development</a>
137-
<p class="related-author">By Jonas Schmedtmann</p>
138+
<div>
139+
<a href="#" class="related-link">How to Learn Web Development</a>
140+
<p class="related-author">By Jonas Schmedtmann</p>
141+
</div>
138142
</li>
139-
<li>
143+
<li class="related-post">
140144
<img
141145
src="img/related-2.jpg"
142146
alt="Lightning"
143147
width="75"
144148
height="75"
145149
/>
146-
<a href="#">The Unknown Powers of CSS</a>
147-
<p class="related-author">By Jim Dillon</p>
150+
<div>
151+
<a href="#" class="related-link">The Unknown Powers of CSS</a>
152+
<p class="related-author">By Jim Dillon</p>
153+
</div>
148154
</li>
149-
<li>
155+
<li class="related-post">
150156
<img
151157
src="img/related-3.jpg"
152158
alt="JavaScript code on a screen"
153159
width="75"
154160
height="75"
155161
/>
156-
<a href="#">Why JavaScript is Awesome</a>
157-
<p class="related-author">By Matilda</p>
162+
<div>
163+
<a href="#" class="related-link">Why JavaScript is Awesome</a>
164+
<p class="related-author">By Matilda</p>
165+
</div>
158166
</li>
159167
</ul>
160168
</aside>

ongoing/04-CSS-Layouts/style.css

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ nav a:link {
197197
display: block; */
198198

199199
margin-right: 30px;
200-
margin-top: 10px;
201200
display: inline-block;
202201
}
203202

@@ -267,13 +266,13 @@ nav p {
267266
} */
268267

269268
/* FLOATS */
269+
/*
270270
.author-img {
271271
float: left;
272272
margin-bottom: 20px;
273273
}
274274
275275
.author {
276-
/* padding-left: 80px; */
277276
float: left;
278277
padding-top: 10px;
279278
margin-left: 20px;
@@ -287,10 +286,6 @@ nav {
287286
float: right;
288287
}
289288
290-
/* .clear {
291-
clear: both;
292-
} */
293-
294289
.clearfix::after {
295290
clear: both;
296291
content: "";
@@ -310,3 +305,42 @@ aside {
310305
footer {
311306
clear: both;
312307
}
308+
*/
309+
310+
.main-header {
311+
display: flex;
312+
align-items: center;
313+
justify-content: space-between;
314+
}
315+
316+
.author-box {
317+
display: flex;
318+
align-items: center;
319+
}
320+
321+
.author {
322+
margin-bottom: 0;
323+
margin-left: 15px;
324+
}
325+
326+
.related-post {
327+
display: flex;
328+
align-items: center;
329+
gap: 20px;
330+
margin-bottom: 30px;
331+
}
332+
333+
.related-link:link {
334+
font-size: 17px;
335+
font-weight: bold;
336+
font-style: normal;
337+
margin-bottom: 5px;
338+
display: block;
339+
}
340+
341+
.related-author {
342+
margin-bottom: 0;
343+
font-size: 14px;
344+
font-weight: normal;
345+
font-style: italic;
346+
}

0 commit comments

Comments
 (0)