Design comparison
SolutionDesign
Solution retrospective
This is my finished project. I have two doubts in this section
- How to justify the advice content like shown in the demo design?
- How to resize the
card-div
according to the content?
Community feedback
- Account deleted
Hi there! Congrats on completing this challenge! 🎉🎊
To justify the content you can use the following property:
text-align: center
.So that the
div
can adapt according to the content of the text, I recommend the following:- Avoid using
width
andheight
, and instead usemin-width
,max-width
andmin-height
,max-height
. Your code would look like this:
.card { margin: auto; margin-top: 10%; max-width: 500px; max-height: 400px; background-color: var(--card); border-radius: 10px; position: relative; text-align: center; }
And so that you can center your card you can do the following:
body { display: flex; background-color: var(--base); font-family: 'Manrope', sans-serif; justify-content: center; align-items: center; min-height: 100vh; }
I hope I've helped. 🙃
Happy coding bro! ✌️💯
1 - Avoid using
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