Earlier quoted context omitted.
I just throw a in, it works well enough for most cases.
I prefer for maximum centeredness
How to Center in CSS (2015)
41–50 of 74 posts
Re: How to Center in CSS (2015)
#42It doesn't solve vertical centering, but I am secretly still a fan of the center-tag. Just does what it's name implies in most situations. I still don't get why its avoided like the plague.
Earlier HTML had tags that styled elements. The community decided it would be better if styling was left to CSS and HTML simply described document structure. This way styling lives in one kind of file instead of two different places. I wouldn’t recommend using it for big or professional projects, but I guess it’s fine for personal stuff. Like the other comment said it’s an obsolete tag. Browsers tend try hard not to…
Re: How to Center in CSS (2015)
#43"What do you mean centering was hard?"
"Not was, still is."
"..."
"yeah. ..."
Re: How to Center in CSS (2015)
#44Earlier quoted context omitted.
I've been doing HTML for ~10 years and have never seen this before. Apparently, it was deprecated with HTML4 already, though I'm not sure why.
Probably the same reason that (bold) and (italics) aren't used anymore. There's now a clearer delineation between document structure (described via tags) and style (described via CSS) than there was in the earlier HTML specs.
Re: How to Center in CSS (2015)
#45Re: How to Center in CSS (2015)
#46Earlier quoted context omitted.
I've been doing HTML for ~10 years and have never seen this before. Apparently, it was deprecated with HTML4 already, though I'm not sure why.
Probably the same reason that (bold) and (italics) aren't used anymore. There's now a clearer delineation between document structure (described via tags) and style (described via CSS) than there was in the earlier HTML specs.
> The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede.
and
> The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts.
Re: How to Center in CSS (2015)
#47Re: How to Center in CSS (2015)
#48.v-h-center { display: grid; place-content: center; }
Re: How to Center in CSS (2015)
#49Centering in CSS is "solved" problem if your "worst" browser to support is IE11. Flexbox does the job there. However, there are still couple of common tasks that are pain/hard/impossible to do with just CSS. Recently I learned that after all this years you still need to use JS to get css animation for dynamic height ("height:auto") of elements. And there is no progress in fixing it at CSS standard level. It's just sa…
There are some tricks you can use if you know the max possible height your element can have, but it's not great, yeah. Edit: Oh, I just saw that the stackoverflow question you linked has this for the accepted answer :)
Re: How to Center in CSS (2015)
#50 .in-the-middle {
width:max-content;
height:auto;
margin:*; // "coils" on all sides moving it
// to the middle of free space in container
}
So these tons of tools, essays and doctoral dissertations on "how to center stuff" would not be needed.Here is the story: https://terrainformatica.com/2018/12/11/10-years-of-flexboxi...