使用CSS垂直居中多个框 [英] Vertically center multiple boxes with CSS

查看:105
本文介绍了使用CSS垂直居中多个框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要垂直居中不同高度的多个箱子。

I need to center vertically multiple boxes with different heights.

我不知道盒子的高度,因为它们是可变文本。

I dont know the height of the boxes as they are variable texts.

我如何使用CSS(不必使用td和valign)。尝试 display:table-cell 但它似乎与IE不兼容

How can I do this with CSS (without having to use td and valign). Tried display: table-cell but it seems not compatible with IE

下面的图片显示了设计, -it是浏览器窗口

The image below shows the design, the post-it is the browser window

已删除死ImageShack链接

removed dead ImageShack link

推荐答案

不那么优雅,但工作。创建单元格表。只有表格具有跨浏览器vertical-align。

Not so elegant, but works. Create one-cell table. Only table has cross-browser vertical-align.

这篇关于使用CSS垂直居中多个框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆