Design comparison
Solution retrospective
To be honest, the text part doesn't convince me, I tried 'text-wrap: balance' and it didn't work for me, can anyone tell me a better solution than using '<br>'?
Community feedback
- @MelvinAguilarPosted over 1 year ago
Hello there 👋. Good job on completing the challenge !
-
Instead of using <br> tags, which can lead to accessibility issues, you can use the
max-width
property andmargin
to control the width and position of your text elements. For example:HTML:
<p ... >Scan the QR code to visit Frontend and take your coding skills to the next level</p>
CSS:
.Container__CardQR-SubTitle { max-width: 26ch; /* Adjust this value to suit your design */ margin-inline: auto; /* Centers the block element horizontally */ }
This would ensure your text block has a maximum character width (
26ch
in the example) and is centered horizontally in its container.
I hope you find it useful! 😄
Happy coding!
Marked as helpful1@iElvisJosuePosted over 1 year agoHello bro! 👋
Thank you for taking the time to answer, I will definitely try what you mention, thank you very much! 😄
1 -
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