Re:A div that looks different in every browser
by Dylan16807 on Monday July 09, 2018 @08:27AM
(#17489711)
I want the contents of my div to be centered inside my div.
Just like <center> works, but vertically. You don't need <foo><bar>content</bar></foo> for horizontal centering. I consider it a layering violation to have to do that nesting.
Re:A div that looks different in every browser
by gedy on Monday July 09, 2018 @11:00AM
(#17490659)
Maybe we are misunderstanding each other, but while you don't need an "extra" container, you do need a container with some known height to vertically center the content in:
http://jsfiddle.net/c20gq4pz/
Just like <center> works, but vertically. You don't need <foo><bar>content</bar></foo> for horizontal centering. I consider it a layering violation to have to do that nesting.