How to center a block level element vertically?
问题 Say I have a like so: <table style="margin-left: auto; margin-right: auto;"> <tr> <td> </td> </tr> </table> The margin-* attributes instruct the table to center itself within its parent element. Is there a similar way to center the element vertically? 回答1: This is a very often requested thing to do. There's no simple way to do vertical alignment. There's the vertical-align attribute, but it's for line-alignment of an inline element. Check out this link for different ways to do vertical