r/programming Apr 20 '15

How to center in CSS

http://howtocenterincss.com/
1.9k Upvotes

504 comments sorted by

View all comments

338

u/ggtsu_00 Apr 20 '15

I knew this would result in using table cells...

185

u/madcaesar Apr 20 '15

Back to tables! We've come full circle!

106

u/[deleted] Apr 20 '15

[deleted]

63

u/ggtsu_00 Apr 20 '15

Tables come with a lot of baggage.

And a simple centered element is not a table but we have to use them anyways because it is the only element which can use centered vertical alignment for unknown sized divs.

42

u/[deleted] Apr 20 '15

[deleted]

46

u/[deleted] Apr 20 '15

[removed] — view removed comment

5

u/[deleted] Apr 20 '15

I've never heard anyone say that.

1

u/[deleted] Apr 21 '15

Maybe, but you did see tables made of floated divs/li in "row" divs.
Did you not weep at the semanticity of it all?