Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Your session has expired please log in again.
Your session has expired please log in again.
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR code component solution using CSS Flexbox

Assem 20

@assem-frontdev

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 struggle a bit when trying to centre the box both horizontally and vertically using flexbox and my question is: are there any other options to centre the element without giving the container 100vh?
  • I would appreciate your feedback on my work );

Community feedback

@Fasunle

Posted

div tag with class container should be the direct element of body tag i.e <div class="container"></div>

use landmarking tags such as nav, header, main, footer to help with accessibility.

don't use section tag directly inside body tag

I suggest you don't give the container a fixed height of 100vh

Just use display:flex; and center it by specifying justify-content: center; and align-items:center; on the container.

You can add padding to the container. This will prevent your bar from using full 100% width on mobile.

on you card component, you could set max-width: max-content; to prevent getting too big on larger screen.

You could check my version of this and leave a comment.

I hope you find this useful 😊

0

Assem 20

@assem-frontdev

Posted

@Fasunle Thanks for your feedback.

0
Dan Kant 310

@Dan-Kant

Posted

Good day Assem. I also had the problem centering the box. However, I solved it by setting both html and body's widths and heights to 100% and then by applying flexbox properties I positioned it to the center of the viewport. Give it a try. I'll be delighted if I could be of use.

0

Assem 20

@assem-frontdev

Posted

@Dan-Kant Thanks for your feedback.

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