Skip to content

Commit 895196f

Browse files
author
Ronan
committed
Use flexbox for overall layout of blog post
1 parent 91d46d5 commit 895196f

File tree

2 files changed

+151
-130
lines changed

2 files changed

+151
-130
lines changed

starter/04-CSS-Layouts/index.html

Lines changed: 134 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -30,139 +30,143 @@ <h1>📘 The Code Magazine</h1>
3030
<!-- <div class="clear"></div> -->
3131
</header>
3232

33-
<article>
34-
<header class="post-header">
35-
<h2>The Basic Language of the Web: HTML</h2>
36-
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-
class="author-img"
44-
/>
45-
<p id="author" class="author">
46-
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
47-
</p>
48-
</div>
49-
50-
<img
51-
src="img/post-img.jpg"
52-
alt="HTML code on a screen"
53-
width="500"
54-
height="200"
55-
class="post-img"
56-
/>
57-
<button>❤️ Like</button>
58-
</header>
59-
60-
<p>
61-
All modern websites and web applications are built using three
62-
<em>fundamental</em>
63-
technologies: HTML, CSS and JavaScript. These are the languages of the
64-
web.
65-
</p>
66-
67-
<p>
68-
In this post, let's focus on HTML. We will learn what HTML is all
69-
about, and why you too should learn it.
70-
</p>
71-
72-
<h3>What is HTML?</h3>
73-
<p>
74-
HTML stands for <strong>H</strong>yper<strong>T</strong>ext
75-
<strong>M</strong>arkup <strong>L</strong>anguage. It's a markup
76-
language that web developers use to structure and describe the content
77-
of a webpage (not a programming language).
78-
</p>
79-
<p>
80-
HTML consists of elements that describe different types of content:
81-
paragraphs, links, headings, images, video, etc. Web browsers
82-
understand HTML and render HTML code as websites.
83-
</p>
84-
<p>In HTML, each element is made up of 3 parts:</p>
85-
86-
<ol>
87-
<li class="first-li">The opening tag</li>
88-
<li>The closing tag</li>
89-
<li>The actual element</li>
90-
</ol>
91-
92-
<p>
93-
You can learn more at
94-
<a
95-
href="https://developer.mozilla.org/en-US/docs/Web/HTML"
96-
target="_blank"
97-
>MDN Web Docs</a
98-
>.
99-
</p>
100-
101-
<h3>Why should you learn HTML?</h3>
102-
103-
<p>
104-
There are countless reasons for learning the fundamental language of
105-
the web. Here are 5 of them:
106-
</p>
107-
108-
<ul>
109-
<li class="first-li">
110-
To be able to use the fundamental web dev language
111-
</li>
112-
<li>
113-
To hand-craft beautiful websites instead of relying on tools like
114-
Worpress or Wix
115-
</li>
116-
<li>To build web applications</li>
117-
<li>To impress friends</li>
118-
<li>To have fun 😃</li>
119-
</ul>
120-
121-
<p>Hopefully you learned something new here. See you next time!</p>
122-
</article>
123-
124-
<aside>
125-
<h4>Related posts</h4>
126-
127-
<ul class="related">
128-
<li class="related-post">
129-
<img
130-
src="img/related-1.jpg"
131-
alt="Person programming"
132-
width="75"
133-
height="75"
134-
/>
135-
<div>
136-
<a href="#" class="related-link">How to Learn Web Development</a>
137-
<p class="related-author">By Jonas Schmedtmann</p>
33+
<div class="row">
34+
<article>
35+
<header class="post-header">
36+
<h2>The Basic Language of the Web: HTML</h2>
37+
38+
<div class="author-box">
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+
/>
46+
<p id="author" class="author">
47+
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
48+
</p>
13849
</div>
139-
</li>
140-
<li class="related-post">
141-
<img
142-
src="img/related-2.jpg"
143-
alt="Lightning"
144-
width="75"
145-
height="75"
146-
/>
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>
151-
</li>
152-
<li class="related-post">
50+
15351
<img
154-
src="img/related-3.jpg"
155-
alt="JavaScript code on a screen"
156-
width="75"
157-
height="75"
52+
src="img/post-img.jpg"
53+
alt="HTML code on a screen"
54+
width="500"
55+
height="200"
56+
class="post-img"
15857
/>
159-
<div>
160-
<a href="#" class="related-link">Why JavaScript is Awesome</a>
161-
<p class="related-author">By Matilda</p>
162-
</div>
163-
</li>
164-
</ul>
165-
</aside>
58+
<button>❤️ Like</button>
59+
</header>
60+
61+
<p>
62+
All modern websites and web applications are built using three
63+
<em>fundamental</em>
64+
technologies: HTML, CSS and JavaScript. These are the languages of
65+
the web.
66+
</p>
67+
68+
<p>
69+
In this post, let's focus on HTML. We will learn what HTML is all
70+
about, and why you too should learn it.
71+
</p>
72+
73+
<h3>What is HTML?</h3>
74+
<p>
75+
HTML stands for <strong>H</strong>yper<strong>T</strong>ext
76+
<strong>M</strong>arkup <strong>L</strong>anguage. It's a markup
77+
language that web developers use to structure and describe the
78+
content of a webpage (not a programming language).
79+
</p>
80+
<p>
81+
HTML consists of elements that describe different types of content:
82+
paragraphs, links, headings, images, video, etc. Web browsers
83+
understand HTML and render HTML code as websites.
84+
</p>
85+
<p>In HTML, each element is made up of 3 parts:</p>
86+
87+
<ol>
88+
<li class="first-li">The opening tag</li>
89+
<li>The closing tag</li>
90+
<li>The actual element</li>
91+
</ol>
92+
93+
<p>
94+
You can learn more at
95+
<a
96+
href="https://developer.mozilla.org/en-US/docs/Web/HTML"
97+
target="_blank"
98+
>MDN Web Docs</a
99+
>.
100+
</p>
101+
102+
<h3>Why should you learn HTML?</h3>
103+
104+
<p>
105+
There are countless reasons for learning the fundamental language of
106+
the web. Here are 5 of them:
107+
</p>
108+
109+
<ul>
110+
<li class="first-li">
111+
To be able to use the fundamental web dev language
112+
</li>
113+
<li>
114+
To hand-craft beautiful websites instead of relying on tools like
115+
Worpress or Wix
116+
</li>
117+
<li>To build web applications</li>
118+
<li>To impress friends</li>
119+
<li>To have fun 😃</li>
120+
</ul>
121+
122+
<p>Hopefully you learned something new here. See you next time!</p>
123+
</article>
124+
125+
<aside>
126+
<h4>Related posts</h4>
127+
128+
<ul class="related">
129+
<li class="related-post">
130+
<img
131+
src="img/related-1.jpg"
132+
alt="Person programming"
133+
width="75"
134+
height="75"
135+
/>
136+
<div>
137+
<a href="#" class="related-link"
138+
>How to Learn Web Development</a
139+
>
140+
<p class="related-author">By Jonas Schmedtmann</p>
141+
</div>
142+
</li>
143+
<li class="related-post">
144+
<img
145+
src="img/related-2.jpg"
146+
alt="Lightning"
147+
width="75"
148+
height="75"
149+
/>
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>
154+
</li>
155+
<li class="related-post">
156+
<img
157+
src="img/related-3.jpg"
158+
alt="JavaScript code on a screen"
159+
width="75"
160+
height="75"
161+
/>
162+
<div>
163+
<a href="#" class="related-link">Why JavaScript is Awesome</a>
164+
<p class="related-author">By Matilda</p>
165+
</div>
166+
</li>
167+
</ul>
168+
</aside>
169+
</div>
166170

167171
<footer>
168172
<p id="copyright" class="copyright text">

starter/04-CSS-Layouts/style.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,23 @@ footer {
314314

315315
/* FLEXBOX */
316316

317+
.row {
318+
display: flex;
319+
align-items: flex-start;
320+
gap: 75px;
321+
margin-bottom: 60px;
322+
}
323+
324+
article {
325+
flex: 1;
326+
margin-bottom: 0;
327+
/* background-color: red; */
328+
}
329+
330+
aside {
331+
flex: 0 0 300px;
332+
}
333+
317334
.main-header {
318335
display: flex;
319336
align-items: center;

0 commit comments

Comments
 (0)