Design comparison
SolutionDesign
Solution retrospective
I had a problem with centering the card and I had to give it a margin.
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there ๐. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
- To center an element vertically, you should use a height to its container. In this case it is recommended to use "min-height: 100vh" so that it occupies 100% of the viewport height. e.g.:
.container { min-height: 100vh; }
HTML ๐:
- You can use relative file paths in your images, this can save future errors in your images:
Do:
<img src="./image-product-desktop.jpg" . . .>
Instead of:
<img src="https://github.com/idaomoumi/idaomoumi.productcard.io/blob/main/image-product-desktop.jpg?raw=true" ...>
- Use the
<main>
tag to wrap all the main content of the page instead of the<div>
tag. With this semantic element you can improve the accessibility of your page.
- Use the
<footer>
tag to wrap the footer of the page instead of the<div class="attribution">
. The<footer>
element contains information about the author of the page, the copyright, and other legal information.
- The
<h1>
is the most important heading on the page, In this challenge the perfumer's name can be considered like the title of the page, so it should be the<h1>
I hope you find it useful! ๐
Happy coding!
Marked as helpful1@idaomoumiPosted almost 2 years ago@MelvinAguilar Hi! Thank you for the useful tips they were amazing and I really appreciate it!
1 - To center an element vertically, you should use a height to its container. In this case it is recommended to use "min-height: 100vh" so that it occupies 100% of the viewport height. e.g.:
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord