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

Flex-box

Enrikewoq 20

@Enrikewoq

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 found difficult to center the design vertically. Im not sure if i centered the design as it should or as i could be centered, i created a container with a specific heigth and then i centered using flex box. I would like to know if it was necessary to add a general left, right, bottom and top margin. I insted centered everithing and applied an specific size to the desing.

Community feedback

@harshitBhardwaj97

Posted

I saw your code and found that you wrapped the entire code inside the class design-container and in gave it height of 650px :-

.design-container {
    display : flex;
    align-items : center;
    height : 650px;
}

You can refrain from restricting the height of parent container, and for centering the content vertically, you can use this approach :-

.design-container {
    display : grid;
    place-content : center;
    min-height : 100vh;
}

Or you can also do :-

.design-container {
    display : flex;
    align-items : center;
    justify-content : center;
    min-height : 100vh;
}

I hope you find this suggestion helpful and it solves your problem, Happy Coding !

Marked as helpful

1

Enrikewoq 20

@Enrikewoq

Posted

VERY HELPFULL thank you sm! haha i was trying to be the most accurate possible thanks!@harshitBhardwaj97

0
P. Ricardo 2,370

@pRicard0

Posted

You should add this to your body:

body {
    min-height: 100vh;
    justify-content: center;
}

You can also add a box-shadow to your .design

.design {
    box-shadow: 0px 7px 14px #0000001a;
}

Marked as helpful

1

Enrikewoq 20

@Enrikewoq

Posted

Thanks sr, i will, your commet is really helpfull@pRicard0

0

@zakura1x

Posted

I think to center the card you can add min-height:100vh to the body css

Marked as helpful

1

Enrikewoq 20

@Enrikewoq

Posted

Thank you sm i will!! @zakura1x

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