开发者

Vertically Align A Div

Does anyone have reliable markup/ CSS that vertically align a div across all browsers? Can ge开发者_开发问答t the following working in Firefox but not others..

.parent { display: table; }
.child { display: table-cell; }  /* this panel is to align vertically in the middle*/


if you are vertical aligning simple text you can do:

.container { height:300px; line-height:300px }

If you want to vertical aligng a div then you will need to use some javascript in order to make it work in all browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜