News for hackers. Stuff that matters.
Re:How to Center in CSS (2015) by johnchristopher on Tuesday May 19, 2020 @11:22AM (#23235834)
I am not into the CSS game anymore, if anything needs to be done I'd just go with whatever widgets any CSS framework offers, but why has it been so hard for so long to center things with CSS (I believe flexbox finally fixed it) ?
Re:How to Center in CSS (2015) by onion2k on Tuesday May 19, 2020 @11:29AM (#23235918)
Flexbox did fix it, and it's been available in Chrome since 2013, Firefox since 2014, and everything else since 2015. IE 11 supported enough of the 2012 syntax to be usable. Even IE 10 supports some of it, albeit poorly.
Re:How to Center in CSS (2015) by johnchristopher on Tuesday May 19, 2020 @01:41PM (#23237739)
2015 ? Yeah, I think I remember hearing about flexbox around that time, also when I stopped doing any CSS work (which I had started around ~2000 I think).
Re:How to Center in CSS (2015) by mrweasel on Tuesday May 19, 2020 @11:28AM (#23235901)
I just throw a <center> in, it works well enough for most cases.
Re:How to Center in CSS (2015) by laurentdc on Tuesday May 19, 2020 @11:32AM (#23235963)
I prefer <center style="text-align: center;"> for maximum centeredness
Re:How to Center in CSS (2015) by 6510 on Tuesday May 19, 2020 @12:09PM (#23236447)
<center class="center1 ct cen algn" id="center42" style="text-align: center; margin-left: auto; margin-right: auto;">
Re:How to Center in CSS (2015) by mrweasel on Tuesday May 19, 2020 @11:59AM (#23236318)
I love that
Re:How to Center in CSS (2015) by RyanGoosling on Tuesday May 19, 2020 @11:34AM (#23235973)
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ce...

The <center> element is obsolete and is not in the HTML5 spec...

Re:How to Center in CSS (2015) by mrweasel on Tuesday May 19, 2020 @11:58AM (#23236293)
So? The browser doesn’t care.

You’re right of cause and centering is styling and it doesn’t belong in the html. It just that sometimes I really can’t be bothered with css and the center hr and a ton of br slips in, and it works well enough.