Re:New CSS Features in Firefox 68
by butz on Wednesday July 31, 2019 @03:31PM
(#20577456)
display: flex;
justify-content: center;
align-items: center;
[ Parent
| on HN ]
Re:New CSS Features in Firefox 68
by silverwind on Wednesday July 31, 2019 @04:48PM
(#20578386)
Those will clip child content when they overflow. There is a fix, but only supported by Firefox currently:
justify-content: safe center; align-items: safe center;
I mean, if we're going for multiple attributes anyway, this has worked since long before flexbox:
On the parent:
position: relative;
On the element to be centered: position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);