2013-06-28 74 views
0

搜索了很多指南後,我設法做到了這一點:http://img541.imageshack.us/img541/491/1i7.png但在其他網站上使用它時,文本被放錯了位置(您可以在http://www.indiedb.com/games/celosia處看到)。下面是我使用的代碼:如何以HTML中圖像頂部的文本爲中心

<IMG SRC="http://img196.imageshack.us/img196/2261/vvpp.png"> 
<DIV STYLE="position:absolute; top:10px; left:30px; width:900px; height:25px"> 
<CENTER><FONT SIZE="+1" COLOR="white">Celosia - the gothic memory card game is a game for everyone, new to this genre or veterans, you will truly enjoy the dark atmosphere and awesome music. Help a goddess, travel around the world and unveil a big mystery or test your skills in the Time attack or Boss modes in over 50 levels. Celosia is currently in Alpha stage so everything you see is subject to changes. You can also follow the official Facebook or Twitter page for updates and news.</FONT></CENTER> 
</DIV> 
+0

最好的辦法是我想用你的文本定義div並使用你的圖像作爲div的背景圖像(在CSS中)。 –

回答

0
<DIV STYLE="position:absolute; top:10px; left:30px; width:900px; height:25px;background-url:http://img196.imageshack.us/img196/2261/vvpp.png;"> 
<CENTER><FONT SIZE="+1" COLOR="white">Celosia - the gothic memory card game is a game for  everyone, new to this genre or veterans, you will truly enjoy the dark atmosphere and awesome  music. Help a goddess, travel around the world and unveil a big mystery or test your skills in  the Time attack or Boss modes in over 50 levels. Celosia is currently in Alpha stage so  everything you see is subject to changes. You can also follow the official Facebook or Twitter  page for updates and news.</FONT></CENTER> 
</DIV> 

UPDATE:

試試這個。 http://jsfiddle.net/astephenb/mBu4h/

+0

我已經測試過,它不顯示任何圖像或文本。此外,文本的位置是相同的,你確定它會在當前不是中心嗎? –

相關問題