Responsive product preview card component with only html and css
Design comparison
Solution retrospective
Please tell me the best solution or any mistake that i made. Thank you
Community feedback
- @thisisharsh7Posted about 2 years ago
Hey DlnosMpo, Well done! your solution looks perfect but there are some improvement which could be made
-
For aligning the whole content to the center you can replace
.container{ width: 600px; height: 450px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, 50%);}
withbody{ min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
and you can see content is well aligned to center of the page. -
You can use
<picture>
tag when you want to show different images at different screen sizes and this will not require settingdisplay: hidden or display: block
property to the images.
hope this helps...
Marked as helpful0@DinosMpoPosted about 2 years ago@thisisharsh7 thank you my friend i will learn about the flex and the picture tag
0 -
- @JuarrisonPosted about 2 years ago
Hello, DinosMpo. Congratulations for your work. From what I can see, the HTML tag tag is missing the alt text. This text is a clear description of the image that helps improve the accessibility of the web page. Here is some useful information so you can improve this aspect of the code: https://www.w3schools.com/tags/att_img_alt.asp I hope this has been helpful. Greetings.
Marked as helpful0@DinosMpoPosted about 2 years ago@Juarrison thank you my friend i will try not to forgot the alt tag
0
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