日期:2014-05-17  浏览次数:20762 次

如何让span中的文字水平居中?
<span   style= "   background-image:url(../images/sozhe_discount_018.gif);   width:62px;   height:18px;   position:absolute; "   class= "font-white "> abc </span>

如何让文字居中呢?

------解决方案--------------------
style= "text-align:center;line-height:18px; "
水平居中text-align:center;
设置行高line-height:18px; 同span高度一样,那么文字就可以垂直居中了(仅限一行文本)。
------解决方案--------------------
style= "text-align:center; "