@beowulf1958
Posted
Great job finishing the challenge. I have a few suggestions for further development.
First, the html does not validate, because there is an open <div> with no closing </div>; you need to add the closing </div> tag just before the closing </body> tag.
Second, you are using <h1> and <h4> in class="discount" section for styling purposes (because of their relative sizes) but this is bad practice: <h1> is for the title of a page, or the main heading, and <h4> is for a subheading. Also you have the heading tags in a <div> inside another <div> which is confusing the styling. Try this instead:
<div class="discount">
<p class="og_price">$149.99</p>
<p class="price"><s>$169.99</s></p>
</div>
Now you can style them easily:
.discount {
display: flex;
align-items: center;
gap: 20px;
margin: 10px 20px;
}
.og_price {
font-family: "Fraunces", serif;
font-weight: 700;
color: hsl(158, 36%, 37%);
font-size: 2rem;
}
.price {
color: hsl(228, 12%, 48%);
}
Lastly, you don't need a <div> for your <button>; remove the div and give the button a class of button, and style the button class. This will help with the flex inside the button. Also the cart icon needs a width and height to fit better. Try adding to the button style:
.button {
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
color: white;
/* add */
background-color: hsl(158, 36%, 37%);
font-size: inherit;
gap: 10px;
margin-left: 20px;
width: 270px;
height: 40px;
img {
width: 25px;
height: 25px;
}
}
Hope this helps.
Marked as helpful
@Ashum91
Posted
Thank you so much for the info provided :) @beowulf1958