This is a solution to the QR code component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
- Solution URL: Add solution URL here
- Live URL: (https://n1dovud.github.io/QR-Code-component)
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
Today, I realized that I had to apply the flexbox to the body instead of the main so that the main becomes centered. I learned more about inheritance and its impace on children from parents.
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: var(--light-gray);
}
Unfortunately, I did not quite understand why setting the height of the body to 100vh centered the main content vertically. Logically, I thought as default, the height is always set to 100vh but now I guess there is smth to learn.
- Frontend Mentor - N1Dovud