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

Simple QR-Code component using HTML & CSS with Flexbox

luciferadā€¢ 80

@luciferad

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


Is it ok to set height property to 100vh for body selector to use flexbox?

Community feedback

Shashree Samuelā€¢ 9,260

@shashreesamuel

Posted

Hey good job completing this challenge

Keep up the good work

Your solution looks great however I think that the title of the card is supposed to have a bold font weight and the description should have a heavier font weight

In terms of accessibility issues simply wrap all your content between main tags

I hope this helps

Cheers Happy coding šŸ‘

Marked as helpful

1

luciferadā€¢ 80

@luciferad

Posted

@TheCoderGuru Hey. You are right about the font weight, but I set font weight to 700 & 400 as the help document said. I will wrap my content between main tags. Thanks.

0
kxnzxā€¢ 870

@kxnzx

Posted

Hi @luciferad,

Yes that's okay, it essentially means that the body will take in the whole height of the viewport. Instead of Flexbox you could also use Grid with only two lines to center your card. This is how I would do it:

html, body { width: 100%; height: 100%; }

body { display: grid; place-items: center; }

Marked as helpful

1

luciferadā€¢ 80

@luciferad

Posted

@kxnzx Thanks a lot.

0
kxnzxā€¢ 870

@kxnzx

Posted

@luciferad yrw! ;)

0
Wendyā€¢ 1,670

@wendyhamel

Posted

Yes, that is fine. You can totally do that!

As an alternative to flexbox you can use grid to center the card on the page. Works great in challenges like this. use height: 100vh, display: grid;, and place-items: center; on the body or other wrapper element for the element you want to center on the page.

Have fun coding!

Marked as helpful

0

luciferadā€¢ 80

@luciferad

Posted

@wendyhamel Hey! I have a question. Is it better to use Grid instead of Flexbox? Is it a standard? Thanks.

0
Wendyā€¢ 1,670

@wendyhamel

Posted

@luciferad There is no right or wrong. I use both. It depends on what you wish to accomplish. Sometimes the one fits your needs better then the other. But to give you a baseline, I mostly use flexbox if I want to align one row or column of items, or if the items can just wrap over more rows or lines, without impacting the design or layout. If I want to place items in a more complex layout of more columns (especially if it has different layouts on different screen sizes) I use grid.

Marked as helpful

0
luciferadā€¢ 80

@luciferad

Posted

@wendyhamel Thanks.

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