Skip to content

Commit 5f8a83c

Browse files
committed
Beginning work on Flexbox
1 parent 05d32ce commit 5f8a83c

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

wip/04-CSS-Layouts/flexbox.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Flexbox</title>
88
<style>
9+
910
.el--1 {
1011
background-color: blueviolet;
12+
align-self: flex-start;
13+
order: 2;
1114
}
1215
.el--2 {
1316
background-color: orangered;
@@ -18,12 +21,15 @@
1821
}
1922
.el--4 {
2023
background-color: goldenrod;
24+
align-self: flex-end;
2125
}
2226
.el--5 {
2327
background-color: palevioletred;
28+
order: 1; /*moves items to the end.*/
2429
}
2530
.el--6 {
2631
background-color: steelblue;
32+
order: -1; /*moves items to the beginning of the list; all default to zero.*/
2733
}
2834
.el--7 {
2935
background-color: yellow;
@@ -36,10 +42,15 @@
3642
/* STARTER */
3743
font-family: sans-serif;
3844
background-color: #ddd;
39-
font-size: 40px;
45+
font-size: 34px;
4046
margin: 40px;
4147

4248
/* FLEXBOX */
49+
display: flex;
50+
align-items: center;
51+
/*A flex container will be as tall as the tallest element in it.*/
52+
justify-content: flex-start;
53+
gap: 30px;
4354
}
4455
</style>
4556
</head>

wip/04-CSS-Layouts/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ <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
</header>
3232

3333
<article>
34-
<header class="post-header">
34+
<header class="post-header clearfix">
3535
<h2>The Basic Language of the Web: HTML</h2>
3636

3737
<img

wip/04-CSS-Layouts/style.css

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
/**/
12
* {
2-
/* border-top: 10px solid #1098ad; */
33
margin: 0;
44
padding: 0;
5+
box-sizing: border-box;
56
}
67

78
/* PAGE SECTIONS */
@@ -14,7 +15,7 @@ body {
1415
}
1516

1617
.container {
17-
width: 800px;
18+
width: 1200px;
1819
/* margin-left: auto;
1920
margin-right: auto; */
2021
margin: 0 auto;
@@ -48,10 +49,8 @@ aside {
4849
background-color: #f7f7f7;
4950
border-top: 5px solid #1098ad;
5051
border-bottom: 5px solid #1098ad;
51-
/* padding-top: 50px;
52-
padding-bottom: 50px; */
53-
padding: 50px 0;
54-
width: 500px;
52+
padding: 50px 40px;
53+
box-sizing: border-box;
5554
}
5655

5756
/* SMALLER ELEMENTS */
@@ -82,6 +81,7 @@ h4 {
8281
font-size: 20px;
8382
text-transform: uppercase;
8483
text-align: center;
84+
margin-bottom: 30px;
8585
}
8686

8787
p {
@@ -134,6 +134,7 @@ li:last-child {
134134

135135
.related {
136136
list-style: none;
137+
margin: 0;
137138
}
138139

139140
body {
@@ -265,3 +266,26 @@ footer p {
265266
nav p {
266267
font-size: 18px;
267268
} */
269+
270+
.clearfix::after {
271+
clear: both;
272+
content: "";
273+
display: block;
274+
}
275+
276+
article {
277+
background-color: green;
278+
width: 70%;
279+
float: left;
280+
}
281+
282+
aside {
283+
background-color: red;
284+
width: 25%;
285+
float: right;
286+
}
287+
288+
footer {
289+
background-color: yellow;
290+
clear: both;
291+
}

0 commit comments

Comments
 (0)