Design comparison
Solution retrospective
I did not feel like there was a real difficulty in this project.
I've tried to make it responsive with @media screen but i could'nt find out how to change the img source with the size of the screen.. I just focused on the phone size.
I'll try to work on it for the next project.
Waiting for comments. Thanks for you interest !
Community feedback
- @correlucasPosted over 2 years ago
πΎHello Axel, congratulations for your new solution!
Your desktop version layout is kinda broken, I saw that you've managed the
display: flex
using the body and its not a best practice, let the body for background color size and alignment.I'll give your the tutorial to create this solution with
grid
that's the easiest way to create it:To build this component with 2 columns all you need to do is create a 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).Then all you need is to manage the column with the photo and the text content vertically using
gap
for spacing and flex-direction column to make it vertically.Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/product-preview-card-vanilla-css-and-custom-hover-state-on-hero-85A1JsueD1
π I hope this helps you and 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