Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR Code - Component

@iElvisJosue

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

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

@MelvinAguilar

Posted

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 and margin 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 helpful

1

@iElvisJosue

Posted

Hello 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 GitHub
Discord logo

Join 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