我有一个div缠绕在一起span并使用JS来使跨度淡入淡出(用于推荐).一切正常,除了我无法让span文本居中div.这是相关的代码:
HTML -
<div class="slideshow">
<span style="font-size:12px; color:#333333; font-family:Lucida Grande,Lucida Sans Unicode,Calibri,Arial,sans-serif;">Hi</span>
<span style="font-size:12px; color:#333333; font-family:Lucida Grande,Lucida Sans Unicode,Calibri,Arial,sans-serif;">Goodbye</span>
</div><br />
Run Code Online (Sandbox Code Playgroud)
这是幻灯片CSS -
.slideshow {
width:940px;
height:64px;
background-image:url(../images/quotes.png);
}
Run Code Online (Sandbox Code Playgroud)
谁能告诉我我做错了什么?哦,是的,我试过text-align:center;没有运气.
[编辑]我想补充一下,我也尝试过添加!important,没有任何变化.