File tree Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ <h6>The Basic Language of the Web: HTML</h6>
18
18
-->
19
19
20
20
< div class ="container ">
21
- < header class ="main-header ">
21
+ < header class ="main-header clearfix ">
22
22
< h1 > 📘 The Code Magazine</ h1 >
23
23
24
24
< nav >
@@ -28,6 +28,8 @@ <h1>📘 The Code Magazine</h1>
28
28
< a href ="# "> Flexbox</ a >
29
29
< a href ="# "> CSS Grid</ a >
30
30
</ nav >
31
+ <!-- * Old way to clearing float problem -->
32
+ <!-- <div class="clear"></div> -->
31
33
</ header >
32
34
33
35
< article >
@@ -39,9 +41,10 @@ <h2>The Basic Language of the Web: HTML</h2>
39
41
alt ="Headshot of Laura Jones "
40
42
height ="50 "
41
43
width ="50 "
44
+ class ="author-img "
42
45
/>
43
46
44
- < p id ="author ">
47
+ < p id ="author " class =" author " >
45
48
Posted by < strong > Laura Jones</ strong > on Monday, June 21st 2027
46
49
</ p >
47
50
Original file line number Diff line number Diff line change 22
22
23
23
.main-header {
24
24
background-color : # f7f7f7 ;
25
+ background-color : red;
25
26
/* padding: 20px;
26
27
padding-left: 40px;
27
28
padding-right: 40px; */
@@ -265,3 +266,38 @@ footer p {
265
266
nav p {
266
267
font-size: 18px;
267
268
} */
269
+
270
+ .author-img {
271
+ float : left;
272
+ margin-bottom : 20px ;
273
+ }
274
+
275
+ .author {
276
+ /* padding-left: 80px; */
277
+ margin-top : 10px ;
278
+ margin-left : 20px ;
279
+ float : left;
280
+ }
281
+
282
+ h1 {
283
+ float : left;
284
+ }
285
+
286
+ nav {
287
+ float : right;
288
+ }
289
+
290
+ /* Remem */
291
+ /* * Old way to clearing float problem */
292
+ .clear {
293
+ clear : both;
294
+ }
295
+
296
+ /* * New way to clearing float problem: clearfix hacked */
297
+ .clearfix ::after {
298
+ clear : both;
299
+ content : "" ;
300
+ display : block;
301
+ }
302
+
303
+ /* * !!! Remember that 'float' is an old way to layout website */
You can’t perform that action at this time.
0 commit comments