Live data from Hacker News

CSS: Absolutely positioning things relatively

canvatechblog.com

11–20 of 42 posts

Re: CSS: Absolutely positioning things relatively

#11
post #10

Flex is becoming more and more irrelevant to do layouts. CSS Grid is really solid and it works well on responsive. The possibilities are endless.

For page layout sure, but for stuff like a unknown-length sequence of blocks/tiles/cards of mixed size flexbox is getting more useful, especially now grid-gap is just gap and works on flexbox too.

Re: CSS: Absolutely positioning things relatively

#12
post #11
post #10

Flex is becoming more and more irrelevant to do layouts. CSS Grid is really solid and it works well on responsive. The possibilities are endless.

For page layout sure, but for stuff like a unknown-length sequence of blocks/tiles/cards of mixed size flexbox is getting more useful, especially now grid-gap is just gap and works on flexbox too.

Yes, it is useful for inline positioning, ex. a menu, but for the rest of the things mostly css does solve it without having to do much.

Re: CSS: Absolutely positioning things relatively

#13
post #10

Flex is becoming more and more irrelevant to do layouts. CSS Grid is really solid and it works well on responsive. The possibilities are endless.

Flex and grid are 2 different domains.

Grid is good for making grids.

Flex is good for creating flows of content, like a where all childs has display:inline-block. It supports wrapping when content can't be on a single line.

Re: CSS: Absolutely positioning things relatively

#14
post #10

Flex is becoming more and more irrelevant to do layouts. CSS Grid is really solid and it works well on responsive. The possibilities are endless.

I think the next challenge would be to have a native "masonry" grid feature. That would cover several usecases.

Re: CSS: Absolutely positioning things relatively

#15
post #10

Flex is becoming more and more irrelevant to do layouts. CSS Grid is really solid and it works well on responsive. The possibilities are endless.

Flex and grid are 2 different domains. Grid is good for making grids. Flex is good for creating flows of content, like a where all childs has display:inline-block. It supports wrapping when content can't be on a single line.

Exactly. But we came from using Flex as the defacto system to do layouts and more, now with CSS-Grid it does make sense to use flex for what it was meant for.

Re: CSS: Absolutely positioning things relatively

#16
post #15

Earlier quoted context omitted.

Flex and grid are 2 different domains. Grid is good for making grids. Flex is good for creating flows of content, like a where all childs has display:inline-block. It supports wrapping when content can't be on a single line.

Exactly. But we came from using Flex as the defacto system to do layouts and more, now with CSS-Grid it does make sense to use flex for what it was meant for.

I guess it depends on your past experience, but for most of the teams I've been involved in, it was basically a leap from floats to grids for page layout, with flexbox being a small scale option before and after.

Re: CSS: Absolutely positioning things relatively

#17
post #3

This approach is over-engineered to say the least… You can implement such a layout without using Grid Layout and using just Flex Layout. Also with some min-/max-width tricks you can also completely avoid having media queries in there… For beginners in HTML/CSS this approach is absolutely distracting IMHO.

> You can implement such a layout without using Grid Layout and using just Flex Layout IMO Grid is actually simpler than Flex. Once IE11 is out of the picture, I think it might be worth considering teaching CSS beginners using a Grid-first approach.

Agreed, as soon as you need more than auto-growing AND alignment in 2 dimensions Flexbox becomes a world of pain whilst a grid JustWorks(TM).

Re: CSS: Absolutely positioning things relatively

#18
post #3

This approach is over-engineered to say the least… You can implement such a layout without using Grid Layout and using just Flex Layout. Also with some min-/max-width tricks you can also completely avoid having media queries in there… For beginners in HTML/CSS this approach is absolutely distracting IMHO.

> You can implement such a layout without using Grid Layout and using just Flex Layout IMO Grid is actually simpler than Flex. Once IE11 is out of the picture, I think it might be worth considering teaching CSS beginners using a Grid-first approach.

I agree. You should only use Flex box when you need it, like when you have differing width children and wrapping.

Re: CSS: Absolutely positioning things relatively

#20
In media query section, a gif that shows text block going down, you can see that at mobile scales the spacing between social icons jumps suddenly for seemingly no reason. Was that intended?

In a gif between “It’s probably best to show you” and “Voila”, social icons don’t stick to the image, dangling at the bottom instead. How to make them stick?

Asking it because most commenters here seem to praise the grid, but ignore these little facts. Interesting if these are by design or by overlook and how to fix that.

Post reply on HN