【发布时间】:2014-10-30 09:55:11
【问题描述】:
我试图在所有浏览器中垂直居中一些文本,但由于某种特殊原因,我遇到了这种特定情况的问题。请参阅 Fiddle 以获取示例。我希望 Tester 这个词和图像一样垂直居中。感谢您的帮助。
http://jsfiddle.net/56jxjq69/2/
<div id="heading" style="margin: auto; display: block;">
<a href="http://www.sss.com"><img src="images/newlogo200x200.png" style="width: 50px;
height: 50px;
position: absolute;
margin-left: 2.5%;
margin-top: .5%;"/></a>
<div id="header" style="margin: 0 auto;
padding: 5px 0 0 0 !important;
width: 100% !important;
clear: both;
background-color: black;
color: white;
vertical-align: middle;
height: 70px;">
<span id="headtxt" style="font-family: ethno;
max-height: 80px;
font-size: 50px;
width: 65%;
padding: 0;
display: block;
margin: auto;
line-height: 55px; vertical-align: middle;text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
color: black;">
TESTER</span>
</div></div>
【问题讨论】:
标签: html css text-align