Hacker News new | ask | show | jobs
by BenTheElder 2002 days ago
<center> and the solutions in this post are not equivalent ...

The HTML center tag only horizontally centers the contents which you can do with the simple CSS: `text-align:center` [1]

The examples in this post center horizontally AND vertically.

[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ce...

1 comments

text-align:center does NOT entirely replicate <center>. And has been a source frustration for many.
that's fair, but <center> and this post are still not equivalent at all.