Design comparison
Solution retrospective
I was having trouble with having the image and container div for the text being "responsive". Any suggestions?
I'm open to any advice with positioning the background image too.
Thank you!
Community feedback
- @elaineleungPosted about 2 years ago
Hi David, first off, good work on the whole, and you actually got most of the parts, just need to tweak the values a bit!
Here are some suggestions I have for fixing the responsiveness:
-
You're using a container for controlling the width, which is a good start! Instead of
min-width: 1280px
, change it tomax-width
, which means this is the maximum width we'll allow the container to be at. Usingmin-width
was the main reason things weren't responsive, and I would try a larger breakpoint too, like around 800 or 900px. -
Since you're using flexbox for the hero image and text in the main section, we can use the
flex
property to manage the size (you may not need themax-width
in those containers if you useflex
):.parent-container { padding: 1rem; // this is just to make sure the content doesn't touch the browser sides } .hero-container { flex: 1 1 50%; // feel free to experiment with these values! } .text-container { flex: 1 0 50%; // feel free to experiment with these values! text-align: left; }
-
Lastly, about the background image, I gave this advice to someone else earlier, so I'll just paste my comment here: What I did for the background was, I started it as the mobile version with
background-size: contain
, and then changed that tobackground-size: cover
at around the 800px breakpoint. Since it's an SVG, I just kept the mobile version up until the 1400px point, which was when I changed it to the desktop version withbackground-size: contain
.
Hope some of this can help you, and good luck!
Marked as helpful0@codeDavidCPosted about 2 years ago@elaineleung Thank you for reviewing and I'll make these changes!
0 -
- @HenryAguPosted about 2 years ago
Nice job...but check your responsiveness for the user whenever they use desktop site mode on their mobile devices
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