@beowulf1958
Posted
Congratulations on completing this challenge. Your site has a unique look. I have a few suggestions.
First, if you declare your font-family in the 'body' selector rules, you need not declare it again as the whole document will then have the same font. This saves you five additional lines of code !
Next, to solve the letter spacing problem with the PERFUME element, add one line to the 'perfume' class rules:
body {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
min-height: 100vh;
background-color: rgb(234, 239, 239);
/* -----add font family here----- */
font-family: sans-serif;
}
.perfume {
padding-top: 25px;
padding-left: 25px;
/* -----space out the letters-----*/
letter-spacing: 5px;
}
As for the line striking out the original price, that is easiest to fix in the html using the <s></s> tag ('s' for strikethrough). The more serious issue is the use of h1 and h5 tags for the prices. There should only be one h1 tag on the page (for the title) and the other h2, h3, etc should be reserved for subheadings. That is to say, h1 and h5 have structural, semantic meaning and should not be used for styling; that is what CSS is for. Try this instead:
<div class="price">
<p class="price1">$149.99</p>
<p class="price2"><s>$169.99</s></p>
</div>
and style it
.price {
display: flex;
align-items: center;
gap: 20px;
padding-top: 35px;
padding-left: 25px;
}
.price1 {
color: green;
font-size: 32px;
font-weight: bold;
}
.price2 {
font-size: 14px;
}
Hope this helps. Keep on coding !
Marked as helpful
@MunibAhmad-dev
Posted
Thank you very much for your suggestions. They really helped me a lot. Actually, I was facing those problems. Can I ask you one more thing? I use Flexbox every time. Is that okay?@beowulf1958
@beowulf1958
Posted
@MunibAhmad-dev using flexbox every time is ok. Some people like flexbox, some like grid. It is up to you.
Marked as helpful