1
我想在所有瀏覽器中垂直居中某些文本,並且由於某些特定原因導致出現此問題。請看這個例子的小提琴。我希望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>
我相信你可以在這裏找到答案: [http://stackoverflow.com/questions/7273338/how-to-vertically-align-an-image-inside-div][1] [1]:http://stackoverflow.com/questions/7273338/how-to-vertically-align-an-image-inside-div – N13Design 2014-10-30 01:59:13