2012-01-06 112 views
0

我想知道如何使圖像中的文字變得像圖像一樣。如何將圖像放在圖像下方

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>Title</title> 
</head> 

<body> 
    <center> 
    <img src="http://www.wikima4.com/assets/templates/wikima4/css/images/red.jpg" width= 
    "1200" height="150" /> 
    </center> 

    <div align="justified"> 
    <font size="3" face="calibri">text text text text The quick brown fox jumps over the 
    lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over 
    the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps 
    over the lazy dog The quick brown fox jumps over the lazy dog<br /> 
    <br /> 
    You can download the documentation from this link: Download</font> 
    </div> 
</body> 
</html> 

回答

2

text-align:center;<center>margin:0 auto

看看這個。 http://jsfiddle.net/VnRRA/是你想要的嗎?

更新:http://jsfiddle.net/VnRRA/1/

基本上,我所做的就是,給了家長的div一個id centerize,並告訴它text-align:center;

+0

我剛剛發佈了代碼。我不知道發生了什麼,它刪除了我發佈的那個 – tintincutes 2012-01-06 09:29:10

+0

是否可以讓它在中心對齊? – tintincutes 2012-01-06 09:42:09

+0

我注意到你在CSS字段集中添加了。如果我只有文本板爲html,會怎麼樣?我應該在哪裏添加它在我的html代碼上? – tintincutes 2012-01-06 09:48:30

0

爲了給多張圖片做到這一點,你也可以使用一個表作爲文本的行和用於圖像的另一行。使用這種方法,您可以將文本放置在圖像的上方或下方。即

<table> 
    <tr> 
     <td class="CSS Settings"> image 1 </td> 
     <td class="CSS Settings"> image 2 </td> 
     <td class="CSS Settings"> image 3 </td> 
    </tr> 
    <tr> 
     <td class="CSS Settings"> Text for image 1 </td> 
     <td class="CSS Settings"> Text for image 2 </td> 
     <td class="CSS Settings"> Text for image 3 </td> 
    </tr> 
</table>