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 solution using flexbox

LuckyPortโ€ข 100

@LuckyPort

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


Feel free to judge and comment. Really appriciate all the comment

Community feedback

@MelvinAguilar

Posted

Hello there ๐Ÿ‘‹. Good job on completing the challenge !

I have some suggestions about your code that might interest you.

HTML ๐Ÿท๏ธ:

  • The <br> tag is often used to create line breaks, but it doesn't convey any semantic meaning. When a screen-reader reads the text, it will break the flow of reading at the line break tag, which can be confusing for users.

CSS ๐ŸŽจ:

  • The width: 100vw property in the main tag is not necessary. This will create a horizontal scrollbar on some devices.
  • Use min-height: 100vh instead of height. Setting the height to 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation.
  • Do not use overflow: hidden on the body element, this will prevent scrolling on some devices. โš ๏ธ
  • In this challenge, a media query is not necessary. If you want to create a responsive component, use max-width instead of width, add some margin and remove its height. Let the content determine the height of the component.

    .kartu {
        /* position: relative; */
        /* height: 600px; */
        /* width: 400px; */
        max-width: 400px;
        margin: 1rem;
    }
    
    @media screen and (max-width: 720px) {
      .kartu {
        /* width: 90%; */
        /* height: 550px; */
      }
    }
    
  • In the image, it is not necessary to use a height or flex. When using width: 100%, the height adjusts automatically

    .kartu > img {
        /* flex: 2; */
        border-radius: 15px;
        /* height: 100%; */
        width: 100%;
    }
    
    @media screen and (max-width: 720px) {
      .kartu > img {
        /* height: inherit; */
      }
    }
    

I hope you find it useful! ๐Ÿ˜„ Above all, the solution you submitted is great!

Happy coding!

Marked as helpful

2

LuckyPortโ€ข 100

@LuckyPort

Posted

@MelvinAguilar Thank you for the suggestion i really appreciate it was really help full. I'll applying your suggestion on another challenge โ˜บ๏ธ

1
Abdul Khaliq ๐Ÿš€โ€ข 72,660

@0xabdulkhaliq

Posted

Hello there ๐Ÿ‘‹. Congratulations on successfully completing the challenge! ๐ŸŽ‰

  • I have other recommendations regarding your code that I believe will be of great interest to you.

HEADINGS โš ๏ธ:

  • And, This solution generates accessibility error reports due to lack of level-one heading <h1>
  • Every site must want at least one h1 element identifying and describing the main content of the page.
  • An h1 heading provides an important navigation point for users of assistive technologies, allowing them to easily find the main content of the page.
  • So we want to add a level-one heading to improve accessibility by reading aloud the heading by screen readers, you can achieve this by adding a sr-only class to hide it from visual users (it will be useful for visually impaired users)

I hope you find this helpful ๐Ÿ˜„ Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

1

LuckyPortโ€ข 100

@LuckyPort

Posted

@0xAbdulKhalid Thank you for the suggestion looking forward to apply this in next challenges thank you :)

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