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-adam778Posted almost 2 years ago
Good job it almost match the design.
- There is many ways for centering, one of them is to use
position
css property withtransform
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 helpful0 - There is many ways for centering, one of them is to use
- @pjevicPosted almost 2 years ago
I used FlexBox to centre... Although, small padding on the paragraph helped me, too.
0 - @MoshiurRaihan95Posted almost 2 years ago
@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 GitHubJoin 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