@MelvinAguilar
Posted
Hi @Azulio123 👋, good job completing this challenge, and welcome to the Frontend Mentor Community! 🎉
Here are some suggestions you might consider:
- There are two modern CSS techniques to center elements instead of using margin property.
Using flexbox layout:
body {
margin: 0;
width: 100%;
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
Using grid layout:
body {
margin: 0;
width: 100%;
min-height: 100vh;
display: grid;
place-content: center;
}
Links with more information:
- The Complete Guide to Centering in CSS.
- A Complete Guide to Flexbox (CSS-Tricks).
- How TO - Center Elements Vertically (W3Schools).
- CSS Layout - Horizontal & Vertical Align (W3Schools).
.
- You could use the <del> tag to display the old price:
<del>
<span class="sr-only">Old price: </span>$169.99
</del>
Note that I added the <span> with the sr-only
class to the del
element, this will provide more information about what your old price is about.
The sr-only
class is a class that you can add to hide content visually but is only visible to screen-readers:
I hope those tips will help you.
Good Job and happy coding !
Marked as helpful
@Azulio123
Posted
@MelvinAguilar Thanks for the great feedback! I actually need to clean up my css file because some of the classes and rules are superfluous. The margin rules in almost all of them are completely useless, so I still need to learn the proper dark art of centering content. This is certainly helpful. I have a lot of stuff to go through, but looking through the flexbox documentation, I think my life will be a lot easier going forward.
I am also intrigued by sr-only content and making things on the web accessible to more people. Definitely a good thing to consider!
All in all, another 10/10 piece of feedback. Thank you again and hopefully I will see your feedback again on my next challenge. :D