News for hackers. Stuff that matters.
Re:How to center a div in CSS by mminer237 on Tuesday February 13, 2024 @06:12PM (#39364167)
I haven't really found much use for CSS grid. It's fine if you're doing a strict grid, but it seems to have all the limitations of a literal table to me. You can't put two objects in one cell. It has no way to wrap. It just isn't responsive at all. You can't make a sidebar with grid. You basically have to just write multiple styles and switch between them with media queries.

In practice, I find making a fake grid out of flex boxes much more usable. About the only thing grid does easier is letting you place a footer correctly. (Although you gotta make sure you count elements correctly because if you insert an extra element before your grid's footer, it will be rendered after.)

Re:How to center a div in CSS by wruza on Tuesday February 13, 2024 @08:40PM (#39365331)
Grid also doesn’t break in media print. Neither does flex, but at least you can make a div of flexes, so that div breaks.
Re:How to center a div in CSS by thr33 on Tuesday February 13, 2024 @06:59PM (#39364568)
you can do everything you just mentioned with grid more reliably and by writing significantly less css than the flex method.