垂直对齐:在Chrome基线不工作 [英] Vertical align : baseline doesnt work in Chrome
问题描述
我有一个非常愚蠢的问题,说实话。 反正这里不用。 我一直试图用垂直对齐:基准线;这是工作本身。问题是,它工作在IE和Firefox。我的问题是,由于某种奇怪的原因,它在浏览器不工作。 在铬的问题截图 http://img576.imageshack.us/img576/8976/chromem.png
I have this really silly question to be honest. Anyways here goes. Ive been trying to use the vertical align: baseline; which is working in itself. The problem is that it works in IE and Firefox. My problem is that for some wierd reason it doesnt work in Chrome. a screenshot of the problem in chrome http://img576.imageshack.us/img576/8976/chromem.png
这是怎么它应该看起来像(有一个14px的填充否则会在最高层) http://img62.imageshack.us/img62/140/firefoxi.png 它会在IE浏览器一样的Firefox浏览器。
And this is how its supposed to look like ( There is a 14px padding else it would be at the very top) http://img62.imageshack.us/img62/140/firefoxi.png it looks the same in IE as in firefox.
我不是使用一个表来我的图片和文字(只是指出) 我希望有人能帮助我,因为这已经让我头疼2天现在差不多:(
Im not using a table to my images and texts (Just pointing out) I hope that someone can help me because this has been giving me headaches for 2 days now almost :(
推荐答案
如果您设置背景的div 显示:表
键,每一个它的孩子显示:表细胞
,它应该工作
If you set the background div to display: table
and each of it's children to display: table-cell
, it should work.
#outer_div
{
display: table; /* display: inline-table; works as well */
}
#outer_div div
{
display: table-cell;
vertical-align: baseline;
}
这篇关于垂直对齐:在Chrome基线不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!