2015-03-08 204 views
-1

我想創建一個鏈接到另一個網站的按鈕,我想添加自己的圖像。 應該使用<input>標籤還是<button>標籤? 謝謝!如何將我自己的圖像添加到鏈接到HTML和CSS中的另一個網站的按鈕?

+0

我應該使用按鈕標記或INPUT標記* * – dehhbes 2015-03-08 17:37:56

+0

我相信你需要使用標籤。 :)嚴重的是,請將代碼格式化爲「標籤」,看起來很奇怪。 – ForceBru 2015-03-08 17:38:20

+0

'' – Musa 2015-03-08 17:39:32

回答

3

如果你想添加一個鏈接到另一個網站,那麼,你需要使用一個href標籤,因爲你想添加一個圖像作爲鏈接,那麼,你需要在一個href裏面添加img標籤標籤像如下代碼:

<a href="Your Destined Page"><img src="Your Desired Image"/></a> 
0

您可以使用HTML表單:無論你願意,你可以使用

<form action="http://yoursite.com"> 
    <input type="submit" value=" to your site"> 
</form> 
0

您可以使用一個按鈕或輸入以及並給它一個背景(彩色或圖像) 檢查了這一點

DEMO

<button type="button" id="button1">My Button with image in background</button> 

#button1 { 
    -webkit-appearance : none; 
    -moz-appearance : none; 
    border : none; 
    background : url('http://upload.wikimedia.org/wikipedia/en/thumb/f/f2/Core_Image_icon.png/96px-Core_Image_icon.png'); 
    background-size : 100% 100%; 
    background-repeat : no-repeat; 
    width : 200px; 
    height : 100px; 
    box-shadow : 2px 2px 2px 1px gray; 
} 
相關問題