Skip to content

Commit 710f114

Browse files
张欧文张欧文
张欧文
authored and
张欧文
committed
start lecture 48
1 parent b73473a commit 710f114

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

starter/04-CSS-Layouts/index.html

Lines changed: 4 additions & 1 deletion
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>
@@ -39,6 +41,7 @@ <h2>The Basic Language of the Web: HTML</h2>
3941
alt="Headshot of Laura Jones"
4042
height="50"
4143
width="50"
44+
class="author-img"
4245
/>
4346

4447
<p id="author">

starter/04-CSS-Layouts/style.css

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ body {
2727
padding-right: 40px; */
2828
padding: 20px 40px;
2929
margin-bottom: 60px;
30-
/* height: 80px; */
30+
height: auto;
3131
}
3232

3333
nav {
@@ -265,3 +265,28 @@ footer p {
265265
nav p {
266266
font-size: 18px;
267267
} */
268+
269+
/* float */
270+
.author-img {
271+
float: left;
272+
}
273+
274+
#author {
275+
float: left;
276+
margin-top: 10px;
277+
margin-left: 20px;
278+
}
279+
280+
h1 {
281+
float: left;
282+
}
283+
284+
nav {
285+
float: right;
286+
}
287+
288+
.clearfix::after {
289+
content: "";
290+
clear: both;
291+
display: block;
292+
}

0 commit comments

Comments
 (0)