Live data from Hacker News

CSS adds vertical centering in 2024

build-your-own.org

1–10 of 50 posts

Re: CSS adds vertical centering in 2024

#2
It's kind of funny seeing center-aligned "align-content just works!" aligned-left within the div in Firefox ESR. This is definitely a bleeding edge feature but a welcome one. It'll be some years before I chose to use it.

edit: It's in the top left, not centered horizontally or vertically.

Re: CSS adds vertical centering in 2024

#3
post #2

It's kind of funny seeing center-aligned "align-content just works!" aligned-left within the div in Firefox ESR. This is definitely a bleeding edge feature but a welcome one. It'll be some years before I chose to use it. edit: It's in the top left, not centered horizontally or vertically.

You do realize this is about vertical alignment, right?

Re: CSS adds vertical centering in 2024

#4
post #2

It's kind of funny seeing center-aligned "align-content just works!" aligned-left within the div in Firefox ESR. This is definitely a bleeding edge feature but a welcome one. It'll be some years before I chose to use it. edit: It's in the top left, not centered horizontally or vertically.

Per the article, _align_ is for vertical distribution, and _justify_ is for horizontal. The example is actually behaving correctly. The naming is confusing though, imo

Re: CSS adds vertical centering in 2024

#6
post #2

It's kind of funny seeing center-aligned "align-content just works!" aligned-left within the div in Firefox ESR. This is definitely a bleeding edge feature but a welcome one. It'll be some years before I chose to use it. edit: It's in the top left, not centered horizontally or vertically.

Firefox has supported this since 125. So if you are on ESR 128 it should work fine

https://caniuse.com/mdn-css_properties_align-content_block_c...

Re: CSS adds vertical centering in 2024

#7
post #2

It's kind of funny seeing center-aligned "align-content just works!" aligned-left within the div in Firefox ESR. This is definitely a bleeding edge feature but a welcome one. It'll be some years before I chose to use it. edit: It's in the top left, not centered horizontally or vertically.

[deleted]

Re: CSS adds vertical centering in 2024

#8
post #2

It's kind of funny seeing center-aligned "align-content just works!" aligned-left within the div in Firefox ESR. This is definitely a bleeding edge feature but a welcome one. It'll be some years before I chose to use it. edit: It's in the top left, not centered horizontally or vertically.

[deleted]

Re: CSS adds vertical centering in 2024

#9
post #2

It's kind of funny seeing center-aligned "align-content just works!" aligned-left within the div in Firefox ESR. This is definitely a bleeding edge feature but a welcome one. It'll be some years before I chose to use it. edit: It's in the top left, not centered horizontally or vertically.

Per the article, _align_ is for vertical distribution, and _justify_ is for horizontal. The example is actually behaving correctly. The naming is confusing though, imo

Well, to center the text in flow layout, you would use text-align:center;
Post reply on HN