Skip to content

Commit 677500c

Browse files
committed
aligning aside and article with flexbox
1 parent 65b3258 commit 677500c

File tree

2 files changed

+149
-132
lines changed

2 files changed

+149
-132
lines changed

practice/04 - CSS Layouts/index.html

Lines changed: 133 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -31,141 +31,142 @@ <h1>📘 The Code Magazine</h1>
3131
<!-- <div class="clear"></div>-->
3232
</header>
3333

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

170171
<footer>
171172
<p class="copyright text" id="copyright">

practice/04 - CSS Layouts/style.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,20 @@ footer {
350350
font-style: normal;
351351
margin-bottom: 5px;
352352
display: block;
353+
}
354+
355+
.row {
356+
display: flex;
357+
align-items: flex-start;
358+
gap: 75px;
359+
margin-bottom: 60px;
360+
}
361+
362+
aside {
363+
flex: 0 0 300px;
364+
}
365+
366+
article {
367+
flex: 1;
368+
margin-bottom: 0;
353369
}

0 commit comments

Comments
 (0)