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

Página responsiva

@eduardozamit

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'm not really sure about my container centering method and I intend to implement this code in the future to make it better.

if you have any tips for me i would be grateful!

Community feedback

@Muhammad-adam778

Posted

Good job it almost match the design.

  • There is many ways for centering, one of them is to use position css property with transform property. check this code to know how.
/* For vertical centering*/
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

/* For horizontal centering*/
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

/* For both*/
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  • But first you need to reset margin of <div class="container"> to zero.

  • About accessibility:

  • Try to replace <div class="attribution"> element by <footer> element.

  • I hope this help you.

Marked as helpful

0
Milan 120

@pjevic

Posted

I used FlexBox to centre... Although, small padding on the paragraph helped me, too.

0

@MoshiurRaihan95

Posted

@eduardozamit use flex in the body tag

    background-color: var(--light-gray);
    font-size: 15px;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 1px);
}```
**remove CSS form**
 ```.container {
margin: 12em auto;
}```
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