Responsive product page using CSS flex { Responsive Design }.
Design comparison
Solution retrospective
Hey everyone! Positive reviews from awesome Techies like you mean the world to me. Could you take 60 seconds to go to [ https://product-preview-card-8tsuk6d0p-bthedraft.vercel.app/ ] and share your happy experiences? I will be forever grateful. Thank you in advance for helping me out!
Community feedback
- @ApplePieGiraffePosted almost 2 years ago
Greetings, Brian Wodu Oluohu.! 👋
Congratulations on completing your first Frontend Mentor challenge! 🎉 Good effort on this challenge! 👍
Here are a couple of things I'd like to suggest,
- Avoiding using
px
for setting the value offont-size
in your styles. Instead, use a responsive unit such asem
orrem
so that users will be able to change the size of the text in your site by changing the default font-size of their browser. It might also be worth setting the values for other properties such asmargin
orpadding
in those units so that your entire site will scale with the user's chosen default font-size. If you'd like to learn more about those units in CSS and how all of this works, check out this helpful video on the topic. - Using flexbox to layout more things in your site. Flexbox is a great tool for creating one-dimensional layouts in CSS and worth learning for making layouts in your sites much easier to create. If you’d like to learn more about flexbox and how you can use it, check out this helpful video on it.
- Making sure the card component is centered in the mobile view of the site (currently, it sticks to the left side of the screen).
- Adding
object-fit: cover
to the cover image so that the image does not seem stretched or squeezed when its aspect ratio/dimensions change (especially in the mobile view).
If you’d like to learn more about how to make your site responsive, check out this helpful course.
Hope you find these suggestions helpful. 😊
Hope this helps. 😊
Keep coding (and happy coding, too)! 😁
Marked as helpful0 - Avoiding using
- @HassiaiPosted almost 2 years ago
Replace<div class="container">with the main tag and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
Use the colors that were given in the styleguide.md found in the zip folder you downloaded.
To center .main on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center .main on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .main on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0
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