Skip to content

Sunday, May 24, 2009

The perils of using display: table for layout

When using display:table (with the related table-row and table-cell) to set up columns for a layout, don’t forget to set the vertical-align property. After a while it finally dawned on me why would the padding-top of both columns seemed to be linked to each other and to the margin-top of each column’s first element: say hello to vertical-align: baseline. Change it to something more appropriate for what you're trying to do, maybe top.

0 comments: