But, often the problems are also non-trivial. The web platform is really diversed, there are user-agents everywhere from mobile phone to smart tv and everything between, with extremely varying input methods (touch, mouse, etc), resolutions, pixel densities, performance, etc. Some of the devices are never updated, running a decade old browser. I don't think any other technology faces similar challenges. Actually it's amazing that things work as good as they do.
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...
The fact that there are "JS land" and "CSS land" is one of the problems. There should be better integration between the two, eliminating the need for "hacks" such as replacing stylesheets by JS styling (popular with React, for example). Writing variable-based dynamic CSS is too hard. SASS and other variants don't solve the problem because they are compile-time, not runtime technologies.