@taco-neko
Posted
I noticed you're using absolute positioning to center items while also having a display of flex and using justify-content
. It's a bit redundant, and you should just use one or the other (I'd recommend flex). Or remove all of that and just use margin: auto
.
This part of your code caught my attention:
.attribution {
font-size: 11px;
text-align: center;
position: absolute;
bottom: 0;
font-size: 1em;
left: 50%;
transform: translateX(-50%);
margin-bottom: 15px;
}
You set a font-size
of 11px and then overwrote it with 1em. I'm not sure if this was intentional. Also again, you could center this with margin: 0 auto 15px
or margin: 15px auto
instead of absolute positions.
Marked as helpful
@TwixGamer00
Posted
@taco-neko Hi,
The double font-size wasn't intented, I've removed it.
Can you explain me which parts I should remove and which I should keep or change, to prevent using both justify-content and flex?
@taco-neko
Posted
@TwixGamer00 Remove everything related to the centering that you have used. In this case that means remove the position: absolute
, all the top
left
bottom
right
properties, and the transform
. Then also remove display: flex
, flex-direction
, justify-content
, and align-items
. Replace all of this with a simple margin: auto
.
Simplicity is best when it comes to things like this in CSS. Also, absolute positioning can have unintended effects such as things going out of bounds.
I've also noticed you use pixel values a lot. I suggest using rems instead. See this video.
Also, never set a font-size
in ems unless you know what you are doing. Use rems. See this video for an explanation.
Marked as helpful
@TwixGamer00
Posted
@taco-neko
I changed all units to Rem!
Also removed the position: absolute
and top
left
bottom
, etc. Although i did keep the position absolute on the footer.
Thanks for your feedback!