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
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


A better idea on how I can improve will be appreciated

Community feedback

Lucas ๐Ÿ‘พโ€ข 104,440

@correlucas

Posted

๐Ÿ‘พHello Oluwatosin , congratulations for your new solution!

๐Ÿ‘จโ€๐Ÿ’ป Hereโ€™s some tips to improve your solution code:

1.Remove the background-color: #dee5f1; from the container and add it to body to make it filling all the screen bg:

.cover {
    max-width: 320px;
    /* height: 100%; */
    position: absolute;
    /* background-color: #dee5f1; */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

You tried to align the component using margins but this make this task really tricky and hard control all the content. My advice for you is to use flexbox to create this alignment. First thing you've to do is to add min-height: 100vh to make sure your body will be displaying minimum 100% of the view-port height (this will help the card be ever aligned vertically centered) and then add display: flex; align-items: center; justify-content: center; to make the alignment:

body {
    background-color: #dee5f1;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

โœŒ๏ธ I hope this helps you and happy coding!

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