如何在不同浏览器上垂直对齐文本 [英] How to vertically align text across browsers

查看:103
本文介绍了如何在不同浏览器上垂直对齐文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请注意,我已经通过这个主题的现有链接,似乎没有帮助我的情况。

Please note that I have been through the existing links on this topic and none seem to help in my case.

所有建议如何移动文本垂直,使其看起来对齐。我的情况下的问题是,它已经在Chrome中对齐,所以当我尝试对齐Firefox的文本,那么它不对齐在Chrome中的文本。

All suggest a way of how to move the text vertically so that it appears aligned. The problem in my case is that it is already aligned in Chrome, so when I try to align the text for Firefox then it misaligns the text in Chrome.

请打开


http://jsfiddle.net/UQ4D5/

您会注意到

推荐答案

在css中有两个属性

 display: table-cell;
    vertical-align: middle;

检查现场演示 http://jsfiddle.net/UQ4D5/5/

这篇关于如何在不同浏览器上垂直对齐文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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