News for hackers. Stuff that matters.
Re:I Used Netscape Composer in 2024 by Kwpolska on Friday April 19, 2024 @02:27AM (#40083953)
Horizontal centring was never hard in CSS, it's just `text-align: center` for inline elements and `margin: 0 auto` for block elements. It's vertical centering that was impossible for many years.
Re:I Used Netscape Composer in 2024 by shiomiru on Friday April 19, 2024 @03:23AM (#40084221)
> `margin: 0 auto` for block elements.

margin: 0 auto adds an equal amount of margin to its left and right. This often does have the effect of getting the element centered, but may or may not be what you really need; e.g. it doesn't work if you need real margins, or if you want to nest aligned boxes.

For center tags, browsers to this day use a separate vendor-prefixed property, e.g. text-align: -moz-center. It is still much easier to use than whatever margin/float/flexbox/grid hack standard CSS has come up with, but -moz-center seems to be doomed to an eternal life as a non-standard (albeit ubiquitous) property.

(I remember that not so long ago even Google would set -moz-center on their search page. Such a great opportunity to standardize existing practice, left unexploited for 27 years and counting.)

Re:I Used Netscape Composer in 2024 by tarsinge on Friday April 19, 2024 @03:06AM (#40084136)
`margin: 0 auto` was harder than <center> for a lot of people back then.
Re:I Used Netscape Composer in 2024 by throwaway124219 on Friday April 19, 2024 @06:22AM (#40085038)
Impossible for CSS, but not for the pragmatists who used tables for layout

    <td valign="middle">