4 ms·
> #container {display:flex;} > #foo {margin: auto;} or > display: table-cell; > vertical-align: middle; Where is the mess in these?
by rimantas 13y ago
> #container {display:flex;}
> #foo {margin: auto;}
or
> display: table-cell;
> vertical-align: middle;
Where is the mess in these?
- RaphiePS 13y agoImagine you didn't know anything about CSS and look at your examples. What the heck is margin, and why is it auto? Why would that center something? What are table cells doing in here? To me, it's just completely divorced from the actual meaning. At the risk of repeating my original comment, CSS poorly encapsulates the intent. Yes, it works and it's short, but it's sorta hacky, sorta circuitous. Instead of just telling the computer to center something, you're giving it detailed instructions, instructions it easily could (and thanks to GSS, can) figure out.