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 layout using HTML and CSS

AlabasterRigโ€ข 10

@AlabasterRig

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


Can you point out the errors I have made in this project? Solutions and feedback are welcome.

Community feedback

@MelvinAguilar

Posted

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

The solution looks much better now, I just have a few small suggestions.

HTML ๐Ÿท๏ธ:

  • Since this component involves scanning the QR code, the image is not a decoration, so it must have an alt attribute. The alt attribute should explain its purpose. e.g. QR code to frontendmentor.io

CSS ๐ŸŽจ:

  • 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.
  • Avoid using position: absolute to center an element as it may result in overflow on some screen sizes. Instead, utilize the flexbox or grid layout for centering. Get more insights on centering in CSS here here ๐Ÿ“˜.

    Here is an image of how it would look on a mobile device (taking into account the scroll): screenshot-imgur ๐Ÿ“ธ

    Result using grid layout:

    .outer-frame {
        background-color: hsl(212, 45%, 89%);
        /* position: relative; */
        /* height: 100vh; */
        /* width: 100vw; */
        /* margin: 0; */
        min-height: 100vh;
        display: grid;
        place-content: center;
    }
    
    .inner-frame {
        background-color: hsl(0, 0%, 100%);
        /* position: absolute; */
        min-height: 428px;
        max-width: 275px;
        /* top: 50%; */
        /* left: 50%; */
        border-radius: 17px;
        /* transform: translate(-50%, -50%); */
        text-align: center;
    }
    

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

Happy coding!

Marked as helpful

0
Francisco Carrilloโ€ข 5,560

@frank-itachi

Posted

Hello there ๐Ÿ‘‹. You did a good job!

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

HTML ๐Ÿ“„:

  • Wrap the page's whole main content in the <main> tag.
  • Wrap the <div class="bottom-frame"> inside the <footer> tag.
  • The heading order is important in the html structure so try to always start your headings and/or titles with an <h1> tag and then you can increase by one if you need to use more headings in your html code. So replace the <h3> by the <h1> tag

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

Happy <coding /> ๐Ÿ˜Ž!

Marked as helpful

0

AlabasterRigโ€ข 10

@AlabasterRig

Posted

@frank-itachi Thank you for your Feedback! I will make the changes ASAP! I had issues with the <h1> tag being too big for the frame hence I chose the <h3> tag. I will try to look for a workaround.

Thank you!

0
Kiaraโ€ข 130

@kxtara

Posted

Looks good! Have you tried changing the first h3 tag to an h1 for accessibility?

Happy Coding

0

AlabasterRigโ€ข 10

@AlabasterRig

Posted

@kxtara Hi! Thank you!. I did try changing the <h3> tag to <h1> but it seemed oddly too big for the frame. I Could have increased the frame size but that would go against the design of the layout. But I think I will be giving it a try and see how it goes.

0
Kiaraโ€ข 130

@kxtara

Posted

@AlabasterRig I would try changing the font size on the h1 tag

Marked as helpful

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