@KapteynUniverse
Posted
Hey, nice job.
You can easily center the element with flex and grid. With flex you just need this:
body{
display: flex;
justify-content: center; /* horizontal */
align-items: center; /* vertical */
min-height: 100vh;
}
Also avoid hard coded values like width:320px
. Since this challange is small, there isn't a problem here but it will cause responsiveness issues for the future projects. Using max-width:320px
, max-width:20rem
even would be better.
Using em/rem units instead of pixels recomended for responsiveness and accesibility. Kevin Powell has a couple of videos about them, one is this one, might give you the idea.
Marked as helpful