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

responsive barcode using appropriate div elements and css properties

@Ayodeledavid123

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

@DigitaleWeltLibrary

Posted

Hey, good solution.

Some improvements:

  • give the body tag a height of 100dvh (is the whole screen height)
  • give the img tag a width of 100% to cover the entire width
  • your last p tag is no longer on the card (.barcode-container). Either you remove the height or you give it the value min-content

The improved CSS:

body{
   height: 100dvh;
}

img{
    width: 100%;
}

.barcode-container{
   height: min-content;

   /* use this to have a border in the phone view */
   width: min(300px, 90dvw - 40px);
   /* or */
   box-sizing: border-box;
}

Happy Coding 😉

Marked as helpful

0

@Ayodeledavid123

Posted

noted, thank you@DigitaleWeltLibrary

0

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