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

Jen Mโ€ข 130

@jenmurph4610

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


I am getting better with CSS, although aligning things the way I want still seems to take me some time of trial and error with the properties. I usually end up feeling like I did it the long way and that I am missing some much simpler method. For example in the H1 and P selectors of this project (snipped below). I would love some thoughts on if there are more streamlined methods than what I used here.

Update: Took another look based on feedback and was able to simplify my code some. Thanks to those who provided feedback. I welcome any additional comments to improve :)

Community feedback

Lucas ๐Ÿ‘พโ€ข 104,420

@correlucas

Posted

๐Ÿ‘พHello Jen, congratulations for your solution!

I've checked your code and you need to remove some margins and padding-top to give it the proper alignment, add some flex properties in the body, see the code below:

body {
    font-family: 'Outfit', sans-serif;
    background-color: hsl(212, 45%, 89%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.qr_component {
    background-color: hsl(0, 0%, 100%);
    width: 375px;
    /* height: auto; */
    /* margin: 0 auto; */
    /* margin-top: 100px; */
    border-radius: 20px;
    padding: 15px;
}

If you want to reduce you code and have more control over it, you can use a single div to wrap everything and delete all the classes, note that for this challenge there are only one element for each kind, img, h1 and p. So you can select all of them with its selector without need for classes img, p, h1, div.

Hope it helps and happy codign!

Marked as helpful

1

Jen Mโ€ข 130

@jenmurph4610

Posted

@correlucas Thanks for the tips! Adding the flex properties simplified a lot, I added them to <main> as well and cleaned up my CSS. I also removed the two classes and just used selectors for those instead. They definitely were unnecessary.

Can you elaborate more on what you mean about using a single div? I am not sure I follow you on that part.

1
Kenisaโ€ข 90

@KenisaRenee

Posted

Hey Jen, congratulations on finishing your first challenge! I'm new here too, and I ran into the exact same problem you did:

**All page content should be contained by landmarks

Context:** `<div class="attribution"> Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. Coded by <a href="#">J. Murphy</a>.

</div>`

The way I solved it was by making this a footer section instead of a div. That might be the answer to the other similar warning on your report too.

The CSS looks good to me although I'm not a super trained eye yet. Restructuring the HTML might lend to changing the CSS a little.

Also min-height: 100vh; has been my friend recently. Anyway, you're doing great. Keep going and happy coding!

Marked as helpful

1

Jen Mโ€ข 130

@jenmurph4610

Posted

@KenisaRenee Thanks for checking it out and the tips! I was just looking around and discovered the report and side by side comparison of what I submitted, I didn't even see those errors earlier. I'm going to give it another look tomorrow.

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