Skip to content

Commit cf5a02c

Browse files
author
Ronan
committed
Clear and clearfix hack
1 parent 31411a8 commit cf5a02c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

starter/04-CSS-Layouts/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ <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>
23-
2423
<nav>
2524
<!-- <strong>This is the navigation</strong> -->
2625
<a href="blog.html">Blog</a>
2726
<a href="#">Challenges</a>
2827
<a href="#">Flexbox</a>
2928
<a href="#">CSS Grid</a>
3029
</nav>
30+
<!-- <div class="clear"></div> -->
3131
</header>
3232

3333
<article>

starter/04-CSS-Layouts/style.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ body {
2121
}
2222

2323
.main-header {
24+
background-color:#f7f7f7;
2425
background-color: red;
2526
/* padding: 20px;
2627
padding-left: 40px;
@@ -284,4 +285,14 @@ h1 {
284285

285286
nav {
286287
float: right;
288+
}
289+
290+
.clear {
291+
clear: both;
292+
}
293+
294+
.clearfix::after {
295+
clear: both;
296+
content: '';
297+
display: block;
287298
}

0 commit comments

Comments
 (0)