top | item 34708437

(no title)

ri0t | 3 years ago

Trouble with CSS is still this: https://media.giphy.com/media/yYSSBtDgbbRzq/giphy.gif (Peter Griffin trying CSS)

And centering a div can still be very hard depending on the circumstances.

discuss

order

kroltan|3 years ago

I always see this meme going around, but it's just plain and simply untrue now that Grid can be used reliably.

You can center anything by making the container display:grid; align-content:center; justify-content:center; I don't know of any situations where that wouldn't work. Flex is a bit finnickier to understand with its major/cross axis concept and wrapping, but you can write Grid layouts with your eyes closed.

schwartzworld|3 years ago

It gets better as you practice and learn good practices, and for the kinds of "fun" projects OP wants to do, there's no real downside to using a css framework that abstracts a lot of it away.

> centering a div can still be very hard depending on the circumstances.

Only thing i could think is targeting ancient browsers. I'm curious, do other UI languages not have quirks or edge cases to learn?

bob1029|3 years ago

> And centering a div can still be very hard depending on the circumstances.

Are the circumstances that you are banned from using flex or grid?