<story><title>Absolute Horizontal And Vertical Centering In CSS</title><url>http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/</url></story><parent_chain></parent_chain><comment><author>gmjoe</author><text>Vertical centering isn&amp;#x27;t that useful when you already have to know the height of things... I mean, if you already know the heights, you can just put the numbers in straight.&lt;p&gt;The best way to do &lt;i&gt;real&lt;/i&gt; vertical-centering that works with variable heights, and doesn&amp;#x27;t use JavaScript, is to take advantage of the fact that table cells do this with &amp;quot;vertical-align: middle&amp;quot;. Inexplicably, &lt;i&gt;only&lt;/i&gt; table cells allow true vertical centering with variable heights.&lt;p&gt;So you can either convert the surrounding element to a big ole &amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;&amp;#x2F;td&amp;gt;&amp;lt;&amp;#x2F;tr&amp;gt;&amp;lt;&amp;#x2F;table&amp;gt;, or you can use CSS to give it a property of display: table-cell. And in both cases, give it a &amp;quot;vertical-align: middle&amp;quot;. Then you&amp;#x27;re good to go!&lt;p&gt;And of course, horizontal positioning in the table cell is easy.</text></comment>
<story><title>Absolute Horizontal And Vertical Centering In CSS</title><url>http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/</url></story><parent_chain></parent_chain><comment><author>pmichaud</author><text>The fact that this is an interesting article is a huge indictment of CSS. It was developed for a different, simpler use case, and it&amp;#x27;s obviously the wrong abstraction at this point. Too bad it&amp;#x27;s entrenched.</text></comment>