Product review website using HTML and CSS

Solution retrospective
Dear viewers,
This is my first challenge. Since I know only basic CSS, I'm not successful enough to make my website responsive to mobile versions, and background coloring and position may not be perfect. Here you're commenting on my more basic and fundamental mistakes, which may help my further studies more precious to me.
Thank you.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @correlucas
👾Hi Kishor Kumar, congratulations for your first solution!👋 Welcome to the Frontend Mentor Coding Community!
Here's the step-by-stepy to re-create this solution responsive with
GRID
.1.I think the best way to build this component with two columns is by using
GRID LAYOUT
since it is simpler to manage the columns and then create the media query for mobile. Here’s the steps to create it withgrid
create the main block to hold all the content (you can use<main>
to wrap), set itswidth
asmax-width: 900px
(it's the container size) anddisplay: grid
/grid-template-column: 1fr 1fr
(this means that your component will have two columns with 50% of the container width each thats 450px). To manage the column with the text use flexbox andgap
to give it the spacing between the texts or usepadding-bottom
to separate them.Then to create the mobile version, all you need to do is to change the container flow vertically with
grid-template-column: 1fr
.2.A best practice to have all the image inside the container scaling and respecting the size of the container, you need to add
max-width: 100%
and add alsoobject-fit: cover
to make the image auto-crop when resizing inside the column:img { display: block; object-fit: cover; max-width: 100%; }
✌️ I hope this helps you and happy coding!
Marked as helpful - @torsumkhan
Nice job! It would have been better if you used Grid for the main container. and for the text, use display flex and flex direction: column. You"re CSS is fine but using display grid and flex just makes everything so easier! Hope my feeback helps you in future projects.
Cheers!
Marked as helpful
Join 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