Skip to content

Commit 03bff9b

Browse files
committed
css floats done
1 parent f4eec5b commit 03bff9b

File tree

7 files changed

+161
-83
lines changed

7 files changed

+161
-83
lines changed

starter/03-CSS-Fundamentals/challenge3.css

Lines changed: 0 additions & 26 deletions
This file was deleted.

starter/03-CSS-Fundamentals/challenge3.html

Lines changed: 0 additions & 45 deletions
This file was deleted.

starter/04-CSS-Layouts/flexbox.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
background-color: #ddd;
3939
font-size: 40px;
4040
margin: 40px;
41+
display: flex;
4142

4243
/* FLEXBOX */
4344
}

starter/04-CSS-Layouts/index.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ <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>
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" target="_blank">Flexbox</a>
29+
<a href="./css-grid.html">CSS Grid</a>
3030
</nav>
31+
<!-- <div class="clear"></div> -->
32+
3133
</header>
3234

3335
<article>
@@ -39,9 +41,10 @@ <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

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: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* border-top: 10px solid #1098ad; */
33
margin: 0;
44
padding: 0;
5+
box-sizing: border-box;
56
}
67

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

1617
.container {
17-
width: 800px;
18+
width: 1200px;
1819
/* margin-left: auto;
1920
margin-right: auto; */
2021
margin: 0 auto;
2122
}
2223

2324
.main-header {
2425
background-color: #f7f7f7;
26+
/* background-color: red; */
2527
/* padding: 20px;
2628
padding-left: 40px;
2729
padding-right: 40px; */
@@ -82,6 +84,7 @@ h4 {
8284
font-size: 20px;
8385
text-transform: uppercase;
8486
text-align: center;
87+
margin-bottom: 30px;
8588
}
8689

8790
p {
@@ -134,10 +137,7 @@ li:last-child {
134137

135138
.related {
136139
list-style: none;
137-
}
138-
139-
body {
140-
/* background-color: orangered; */
140+
margin-left: 0;
141141
}
142142

143143
/* .first-li {
@@ -265,3 +265,54 @@ footer p {
265265
nav p {
266266
font-size: 18px;
267267
} */
268+
269+
270+
/* FLOATS */
271+
272+
.author-img{
273+
float: left;
274+
margin-bottom: 20px;
275+
}
276+
.author {
277+
float: left;
278+
margin-top: 10px;
279+
margin-left: 80px;
280+
}
281+
282+
h1 {
283+
float: left;
284+
}
285+
nav {
286+
float:right;
287+
}
288+
289+
/* .clear {
290+
clear: both;
291+
} */
292+
293+
/* ! clear fix hack */
294+
.clearfix::after{
295+
clear: both;
296+
content: "";
297+
display:block;
298+
}
299+
300+
article {
301+
/* background-color: green; */
302+
width: 825px;
303+
float: left;
304+
}
305+
306+
aside {
307+
/* background-color: #1098ad; */
308+
width: 300px;
309+
float: right;
310+
padding: 40px;
311+
}
312+
313+
footer {
314+
/* background-color: red; */
315+
clear: both;
316+
}
317+
318+

starter/challenge/challenge3.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Document</title>
8+
<link rel="stylesheet" href="style.css" />
9+
</head>
10+
<body>
11+
<article class="product">
12+
<h2 class="product-title">Converse Chuck Taylor All Star Low Top</h2>
13+
<div class="container clearfix">
14+
<img
15+
src="https://i.imgur.com/ZrTU3VK.jpeg"
16+
alt="Chuck Taylor All Star Shoe"
17+
height="250px"
18+
width="250px"
19+
class="product-img"
20+
/>
21+
<div class="product-info">
22+
<p class="price"><strong>$65.00</strong></p>
23+
<p class="shipping ">Free shipping</p>
24+
<p class="product-description">
25+
Ready to dress up or down, these classic canvas Chucks are an everyday
26+
wardrobe staple.
27+
</p>
28+
<a href="https://converse.com" target="_blank" class="more-info"
29+
>More information &rarr;</a
30+
>
31+
<div class="colors">
32+
<div class="color color-blue"></div>
33+
<div class="color color-green"></div>
34+
<div class="color color-red"></div>
35+
<div class="color color-yellow"></div>
36+
<div class="color color-red"></div>
37+
<div class="color color-orange"></div>
38+
</div>
39+
</div>
40+
<div class="product-details">
41+
<h3 class="details-title">Product details</h3>
42+
<ul class="details-list">
43+
<li>Lightweight, durable canvas sneaker</li>
44+
<li>Lightly padded footbed for added comfort</li>
45+
<li>Iconic Chuck Taylor ankle patch.</li>
46+
</ul>
47+
</div>
48+
</div>
49+
<button class="add-cart">Add to cart</button>
50+
</article>
51+
</body>
52+
</html>

starter/03-CSS-Fundamentals/style.css renamed to starter/challenge/style.css

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
* {
22
margin: 0;
33
padding: 0;
4+
box-sizing: border-box;
45
}
56

67
body {
@@ -24,16 +25,36 @@
2425
}
2526

2627
/* PRODUCT INFORMATION */
28+
.product-info{
29+
width: 240px;
30+
float: left;
31+
margin-right: 40px;
32+
margin-top: 20px;
33+
}
2734
.price {
2835
font-size: 24px;
36+
float:left;
2937
}
3038

3139
.shipping {
40+
float: right;
3241
font-size: 12px;
3342
text-transform: uppercase;
3443
font-weight: bold;
3544
color: #777;
3645
margin-bottom: 20px;
46+
margin-top: 8px;
47+
}
48+
49+
.clearfix::after {
50+
content: "";
51+
clear: both;
52+
display: block;
53+
}
54+
55+
.product-description {
56+
clear:both;
57+
margin-bottom: 10px;
3758
}
3859

3960
.more-info:link, .more-info:visited {
@@ -43,13 +64,23 @@
4364
.more-info:hover, .more-info:active {
4465
text-decoration: none;
4566
}
67+
68+
.product-img {
69+
float: left;
70+
outline: 1px solid yellow;
71+
margin-right: 40px;
72+
}
4673

4774
/* PRODUCT DETAILS */
75+
.product-details{
76+
width: 240px;
77+
float: left;
78+
margin-top: 20px;
79+
}
4880
.details-title {
4981
text-transform: uppercase;
5082
font-size: 16px;
5183
margin-bottom: 15px;
52-
margin-top: 30px;
5384
}
5485

5586
.details-list {
@@ -104,7 +135,7 @@
104135

105136

106137
.colors {
107-
padding-top: 5px;
138+
padding-top: 20px;
108139
}
109140
.color{
110141
display: inline-block;
@@ -128,4 +159,15 @@ background-color: yellow;
128159
}
129160
.color-orange {
130161
background-color:orange ;
131-
}
162+
}
163+
164+
.container {
165+
/* outline: 2px solid red; */
166+
}
167+
168+
169+
170+
171+
172+
173+

0 commit comments

Comments
 (0)