Skip to content

Commit 24f5ca3

Browse files
committed
Challenge No.2 Section 4 Layouts.
1 parent 32a73f7 commit 24f5ca3

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

starter/02-HTML-Fundamentals/challange_2.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<body>
1010
<article class="product">
1111
<h2 class="product-title">Converse Chuck Taylor All Star Low Top</h2>
12-
<div class="container clearfix">
12+
<div class="container">
1313
<img
1414
src="img/challenges.jpg"
1515
all="Chuck Taylor All Star Low Top"
@@ -19,8 +19,10 @@ <h2 class="product-title">Converse Chuck Taylor All Star Low Top</h2>
1919
/>
2020

2121
<div class="product-info">
22-
<p class="price"><strong>$65.00</strong></p>
23-
<p class="shipping">Free shipping</p>
22+
<div class="product-price">
23+
<p class="price"><strong>$65.00</strong></p>
24+
<p class="shipping">Free shipping</p>
25+
</div>
2426
<p class="sale">Sale</p>
2527
<p class="product-description">
2628
Ready to dress up or down, these classic canvas Chucks are an
@@ -32,7 +34,7 @@ <h2 class="product-title">Converse Chuck Taylor All Star Low Top</h2>
3234
>More information &rarr;</a
3335
>
3436

35-
<div class="colors">
37+
<div class="product-colors">
3638
<div class="color"></div>
3739
<div class="color color-blue"></div>
3840
<div class="color color-red"></div>

starter/02-HTML-Fundamentals/style-for-challange-2.css

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ body {
1616
}
1717
.container {
1818
/* background-color: red; */
19+
display: flex;
20+
gap: 40px;
1921
}
2022

2123
.product-img {
22-
float: left;
23-
margin-right: 40px;
2424
}
2525

2626
/* PRODUCT */
@@ -42,10 +42,16 @@ body {
4242
/* PRODUCT INFOMATION */
4343
.product-info {
4444
/* (825 - 8 - 250 - 80) */
45-
width: 243px;
46-
float: left;
47-
margin-right: 40px;
45+
/* width: 243px; */
4846
margin-top: 20px;
47+
flex: 1;
48+
}
49+
50+
.product-price {
51+
display: flex;
52+
justify-content: space-between;
53+
align-items: center;
54+
margin-bottom: 20px;
4955
}
5056

5157
.price {
@@ -58,9 +64,6 @@ body {
5864
text-transform: uppercase;
5965
font-weight: bold;
6066
color: #777;
61-
margin-bottom: 20px;
62-
float: right;
63-
margin-top: 8px;
6467
}
6568

6669
.sale {
@@ -81,7 +84,6 @@ body {
8184
left: -38px;
8285
}
8386
.product-description {
84-
clear: both;
8587
margin-bottom: 10px;
8688
}
8789
.more-info:link,
@@ -96,12 +98,15 @@ body {
9698
text-decoration: none;
9799
}
98100

101+
.product-colors {
102+
display: flex;
103+
gap: 10px;
104+
}
105+
99106
.color {
100107
background-color: #000;
101108
height: 22px;
102109
width: 22px;
103-
display: inline-block;
104-
margin-right: 10px;
105110
}
106111

107112
.color-blue {
@@ -126,9 +131,9 @@ body {
126131

127132
/* PRODUCT DETAILS */
128133
.product-details {
129-
width: 243px;
130-
float: left;
134+
/* width: 243px; */
131135
margin-top: 20px;
136+
flex: 1;
132137
}
133138

134139
.details-title {

0 commit comments

Comments
 (0)