Skip to content

Commit 91a8085

Browse files
committed
Learning Flexbox
1 parent 5f8a83c commit 91a8085

File tree

3 files changed

+189
-133
lines changed

3 files changed

+189
-133
lines changed

wip/04-CSS-Layouts/flexbox.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
<title>Flexbox</title>
88
<style>
99

10-
.el--1 {
10+
.el {
11+
flex: 0 0 200px; /*flex-shrink, flex-grow, flex-basis all in one command.*/
12+
13+
/*flex-basis: 200px; this is a minimum width not fixed width.*/
14+
/*this will also not cause a container overflow.*/
15+
/*flex-shrink: 0; this will prevent shrinking which can cause container overflow.*/
16+
/*flex-grow: 1;*/
17+
}
18+
.el--1 {
1119
background-color: blueviolet;
1220
align-self: flex-start;
1321
order: 2;

wip/04-CSS-Layouts/index.html

Lines changed: 131 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -30,131 +30,140 @@ <h1>📘 The Code Magazine</h1>
3030
</nav>
3131
</header>
3232

33-
<article>
34-
<header class="post-header clearfix">
35-
<h2>The Basic Language of the Web: HTML</h2>
36-
37-
<img
38-
src="img/laura-jones.jpg"
39-
alt="Headshot of Laura Jones"
40-
height="50"
41-
width="50"
42-
/>
43-
44-
<p id="author">
45-
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
46-
</p>
47-
48-
<img
49-
src="img/post-img.jpg"
50-
alt="HTML code on a screen"
51-
width="500"
52-
height="200"
53-
class="post-img"
54-
/>
55-
<button>❤️ Like</button>
56-
</header>
57-
58-
<p>
59-
All modern websites and web applications are built using three
60-
<em>fundamental</em>
61-
technologies: HTML, CSS and JavaScript. These are the languages of the
62-
web.
63-
</p>
64-
65-
<p>
66-
In this post, let's focus on HTML. We will learn what HTML is all
67-
about, and why you too should learn it.
68-
</p>
69-
70-
<h3>What is HTML?</h3>
71-
<p>
72-
HTML stands for <strong>H</strong>yper<strong>T</strong>ext
73-
<strong>M</strong>arkup <strong>L</strong>anguage. It's a markup
74-
language that web developers use to structure and describe the content
75-
of a webpage (not a programming language).
76-
</p>
77-
<p>
78-
HTML consists of elements that describe different types of content:
79-
paragraphs, links, headings, images, video, etc. Web browsers
80-
understand HTML and render HTML code as websites.
81-
</p>
82-
<p>In HTML, each element is made up of 3 parts:</p>
83-
84-
<ol>
85-
<li class="first-li">The opening tag</li>
86-
<li>The closing tag</li>
87-
<li>The actual element</li>
88-
</ol>
89-
90-
<p>
91-
You can learn more at
92-
<a
93-
href="https://developer.mozilla.org/en-US/docs/Web/HTML"
94-
target="_blank"
95-
>MDN Web Docs</a
96-
>.
97-
</p>
33+
<div class="row">
34+
<article>
35+
<header class="post-header clearfix">
36+
<h2>The Basic Language of the Web: HTML</h2>
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+
/>
44+
45+
<p id="author" class="author">
46+
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
47+
</p>
48+
</div>
9849

99-
<h3>Why should you learn HTML?</h3>
100-
101-
<p>
102-
There are countless reasons for learning the fundamental language of
103-
the web. Here are 5 of them:
104-
</p>
105-
106-
<ul>
107-
<li class="first-li">
108-
To be able to use the fundamental web dev language
109-
</li>
110-
<li>
111-
To hand-craft beautiful websites instead of relying on tools like
112-
Worpress or Wix
113-
</li>
114-
<li>To build web applications</li>
115-
<li>To impress friends</li>
116-
<li>To have fun 😃</li>
117-
</ul>
118-
119-
<p>Hopefully you learned something new here. See you next time!</p>
120-
</article>
121-
122-
<aside>
123-
<h4>Related posts</h4>
124-
125-
<ul class="related">
126-
<li>
127-
<img
128-
src="img/related-1.jpg"
129-
alt="Person programming"
130-
width="75"
131-
height="75"
132-
/>
133-
<a href="#">How to Learn Web Development</a>
134-
<p class="related-author">By Jonas Schmedtmann</p>
135-
</li>
136-
<li>
137-
<img
138-
src="img/related-2.jpg"
139-
alt="Lightning"
140-
width="75"
141-
height="75"
142-
/>
143-
<a href="#">The Unknown Powers of CSS</a>
144-
<p class="related-author">By Jim Dillon</p>
145-
</li>
146-
<li>
14750
<img
148-
src="img/related-3.jpg"
149-
alt="JavaScript code on a screen"
150-
width="75"
151-
height="75"
51+
src="img/post-img.jpg"
52+
alt="HTML code on a screen"
53+
width="500"
54+
height="200"
55+
class="post-img"
15256
/>
153-
<a href="#">Why JavaScript is Awesome</a>
154-
<p class="related-author">By Matilda</p>
155-
</li>
156-
</ul>
157-
</aside>
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>
138+
</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">
153+
<img
154+
src="img/related-3.jpg"
155+
alt="JavaScript code on a screen"
156+
width="75"
157+
height="75"
158+
/>
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>
166+
</div> <!--close class="row"-->
158167

159168
<footer>
160169
<p id="copyright" class="copyright text">

0 commit comments

Comments
 (0)