Skip to content

Commit 589c2c3

Browse files
author
Ronan
committed
Align challenge 2 with solution in video
1 parent 4f2c42d commit 589c2c3

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

starter/04-CSS-Layouts/challenge-2/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2 class="product-title">Converse Chuck Taylor All Star Low Top</h2>
1616
class="product-img"
1717
/>
1818
<div class="product-info">
19-
<div class="product-info-header">
19+
<div class="product-price">
2020
<p class="price"><strong>$65.00</strong></p>
2121
<p class="shipping">Free shipping</p>
2222
</div>
@@ -26,7 +26,7 @@ <h2 class="product-title">Converse Chuck Taylor All Star Low Top</h2>
2626
everyday wardrobe staple.
2727
</p>
2828
<a class="more-info" href="#">More information &rarr;</a>
29-
<div class="colors">
29+
<div class="product-colors">
3030
<div class="color"></div>
3131
<div class="color color-blue"></div>
3232
<div class="color color-red"></div>

starter/04-CSS-Layouts/challenge-2/styles.css

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,44 +53,36 @@ p {
5353
}
5454

5555
.product-img {
56-
/* float: left; */
57-
/* margin-right: 40px; */
5856
}
5957

6058
/* PRODUCT INFO */
6159

6260
.product-info {
63-
/* margin-right: 40px; */
61+
flex: 1;
6462
margin-top: 20px;
65-
/* width: 243px; */
66-
/* float: left; */
6763
}
6864

69-
.product-info-header {
65+
.product-price {
7066
display: flex;
71-
align-items: center;
7267
justify-content: space-between;
68+
align-items: center;
69+
margin-bottom: 10px;
7370
}
7471

7572
.price {
7673
font-size: 20px;
77-
/* margin-bottom: 5px; */
78-
/* float: left; */
74+
margin-bottom: 0;
7975
}
8076

8177
.shipping {
8278
text-transform: uppercase;
8379
color: #777;
8480
font-size: 12px;
8581
font-weight: bold;
86-
/* margin-top: 4px;
87-
margin-bottom: 20px;
88-
margin-left: 20px; */
89-
/* float: right; */
82+
margin-bottom: 0;
9083
}
9184

9285
.product-description {
93-
clear: both;
9486
}
9587

9688
.more-info:link,
@@ -105,20 +97,17 @@ p {
10597
text-decoration: none;
10698
}
10799

108-
.colors {
100+
.product-colors {
109101
display: flex;
110102
gap: 10px;
111103
}
112104

113105
.color {
114-
width: 20px;
115-
height: 20px;
116-
/* display: inline-block; */
117-
/* margin: 0 5px; */
106+
width: 22px;
107+
height: 22px;
118108
}
119109

120110
.color:first-child {
121-
/* margin-left: 0; */
122111
background-color: rgb(66, 66, 66);
123112
}
124113

@@ -140,14 +129,13 @@ p {
140129

141130
.color-brown {
142131
background-color: rgb(125, 83, 28);
143-
margin-right: 0;
144132
}
145133

146134
/* PRODUCT DETAILS */
147135

148136
.product-details {
149-
flex: 0 0 215px;
150-
/* float: left; */
137+
/* flex: 0 0 215px; */
138+
flex: 1;
151139
margin-top: 20px;
152140
}
153141

@@ -165,6 +153,7 @@ p {
165153
.details-list li {
166154
margin-bottom: 10px;
167155
}
156+
168157
/* Button */
169158

170159
.add-to-cart {

0 commit comments

Comments
 (0)