Skip to content

Commit a2e909d

Browse files
committed
section-4: Implemented basic float layout.
1 parent b16f84f commit a2e909d

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

starter/04-CSS-Layouts/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h6>The Basic Language of the Web: HTML</h6>
1818
-->
1919

2020
<div class="container">
21-
<header class="main-header">
21+
<header class="main-header clearfix">
2222
<h1>📘 The Code Magazine</h1>
2323

2424
<nav>
@@ -28,6 +28,8 @@ <h1>📘 The Code Magazine</h1>
2828
<a href="#">Flexbox</a>
2929
<a href="#">CSS Grid</a>
3030
</nav>
31+
32+
<!-- <div class="clear"></div> -->
3133
</header>
3234

3335
<article>
@@ -37,11 +39,12 @@ <h2>The Basic Language of the Web: HTML</h2>
3739
<img
3840
src="img/laura-jones.jpg"
3941
alt="Headshot of Laura Jones"
42+
class="author-image"
4043
height="50"
4144
width="50"
4245
/>
4346

44-
<p id="author">
47+
<p id="author" class="author">
4548
Posted by <strong>Laura Jones</strong> on Monday, June 21st 2027
4649
</p>
4750

starter/04-CSS-Layouts/style.css

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body {
1414
}
1515

1616
.container {
17-
width: 800px;
17+
width: 1200px;
1818
/* margin-left: auto;
1919
margin-right: auto; */
2020
margin: 0 auto;
@@ -265,3 +265,46 @@ footer p {
265265
nav p {
266266
font-size: 18px;
267267
} */
268+
269+
.author {
270+
float: left;
271+
margin-left: 20px;
272+
margin-top: 10px;
273+
}
274+
275+
.author-image {
276+
float: left;
277+
margin-bottom: 20px;
278+
}
279+
280+
h1 {
281+
float: left;
282+
}
283+
284+
nav {
285+
float: right;
286+
}
287+
288+
.clear {
289+
clear: both;
290+
}
291+
292+
.clearfix::after {
293+
clear: both;
294+
content: '';
295+
display: block;
296+
}
297+
298+
article {
299+
float: left;
300+
width: 825px;
301+
}
302+
303+
aside {
304+
float: right;
305+
width: 300px;
306+
}
307+
308+
footer {
309+
clear: both;
310+
}

0 commit comments

Comments
 (0)