2013-04-23 221 views
0

我設計這一個電話差距application..i想在HTML編寫這個..html編碼 - 如何在HTML中的圖像上放置文本?

我有兩個問題..

Q1)我如何放置文本在圖片上不同位置?

作爲text1,text2,text3,text4在這裏給出的圖像。

Q2)如何將其放置在page.i中心給了

<img src="img/img1.png" style="margin-left:5px;" /> 
    <img align="middle" /> 

,但是,這並沒有區別。

指導required.please幫助。

enter image description here

我還有一個疑問......運行該程序後....有頁腳後身體的延伸部分...如果你拖上去....你可以看到thtat在頁眉和頁腳之間的身體延長。它會移動事件的權利。 編碼中的任何錯誤?

+0

可以使用HTML5畫布 – Jacob 2013-04-23 08:08:47

回答

1

把它們放在一個div,然後給這個div背景風格;) 代碼應該是這樣的:

#container{background:url(path/to/img) no-repeat scroll 0 0 transparent; background-size:100% 100%; display:block; height:...px; width:...px;} 
#container span{width:50%; height:25%;display:block; overflow:hidden;float:left;} 

您可以添加邊框:

<div id='container'> 
<span> text 1 </span> 
<span> text 2 </span> 
<span> text 3 </span>  
<span> text 4 </span> 
</div> 
在CSS

跨度,顏色等...

+1

T.Baba做到這一點,它的工作好,謝謝...... – user 2013-04-29 07:00:48

+0

你知道,如何使用Java腳本來實現刷卡VIEW(動態)。根據列的長度,我們可以找到特定列的長度。請回復.......它......非常混亂......對我來說。 – user 2013-04-29 07:04:23

+0

對於刷卡,請查看此鏈接:http://www.awwwards.com/demo/touchSwipe-gallery-demo.html – 2013-04-29 08:40:04

1

你可以通過用div和z-index包裝圖像來做到這一點。您的代碼應該是這樣的:

<div style="position:fixed; top:10px; left:5px; z-index:250; width:ofimage; height:of image;"> 
<span style="display:block; width:30; height:20; margins if you need; float:left">text1</span> 
<span style it accordingly and add float left>text2</span><br> 
<spanstyle them as first two>text3</span> 
<span>text4</span> 

</div> 

<img src="your image" style="if any">