Design comparison
Solution retrospective
couldn't figure out to keep the text from overflowing out the divs and how to center the divs on mobile screens.
Community feedback
- @vanzasetiaPosted over 2 years ago
Hello there! 👋
Good effort on this challenge! 👍 The site looks great on my desktop view. 🙌
To solve the problems that the site currently has is by doing the following.
- First and the most important is to not use absolute positioning and relative positioning as well at all to finish this challenge.
- Second, make the
body
element as the flex container for themain
element. Themain
element is going to be the direct child of thebody
element and wrapping all the cards element. By doing that, you could make the cards perfectly in the middle of the page. It's important to not limit theheight
of thebody
element so usemin-height
instead. - Third, don't set the
height
for the card elements, let the content inside it dictate the height of them. - Fourth, don't use percentage unit to set a
padding
ormargin
. Use eitherrem
orem
units. By using%
, thepadding
will always increase as the screen gets bigger.
I would suggest that for the Learn More buttons, use interactive elements, which in this case the anchor tags would be the best choice. Usually, the Learn More button would navigate the user to a different part of the page or to another page which is what the anchor tag is for.
That's it! Try to keep things as simple as possible and hope you find this useful! 😁
Marked as helpful2 - @AbdelrhmanX7Posted over 2 years ago
hi ac3
if you want to center your element in screen mobile i prefer to use media query you can find all thing you need about media query here (https://www.w3schools.com/css/css_rwd_mediaqueries.asp) second you have a problem in .main you use display relative. you should use position: relative to fix your problem
Marked as helpful1
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