2010-12-03 123 views

回答

4

你有一個以上的可能性要做到這一點:

使用背景圖片(作品在每個瀏覽器,但我個人不喜歡它重新編輯並保存圖像文件的每個小再次詳細) CSS:

button { 
    background: url('some image..'); 
    width: <width of the background image>; 
    height: <height of the background image>; 
    ... 
} 

button:hover { 
    background: url('mouseover image'); 
    ... 
} 

另外,您可以使用較新的CSS屬性創建按鈕。他們提供你想要的一切,它是遠遠比使用背景圖片涼,但不足之處是沒有很多瀏覽器都支持這充分今日(有的不會很長一段時間,是IE瀏覽器,我的意思是你):

button { 
    border: solid 1px somecolor; 
    color: #eee; 
    border-radius:5px; 
-moz-border-radius:5px; 
    background: -moz-linear-gradient(top, #5E5E5E 0%, #474747 51%, #0a0e0a 51%, #0a0809 100%); 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5E5E5E), color-stop(51%,#474747), color-stop(51%,#0a0e0a), color-stop(100%,#0a0809)); 
} 
button:hover { 
    color: white; 
} 

看這裏創建CSS漸變:什麼是可能使用純CSS3 http://www.colorzilla.com/gradient-editor/

印象和教程:

可以使用它們相同的屬性,造型一個textarea:borderbackgroundcolor對字體顏色等

3
<button type="submit" style="border: 0; background: transparent"> 
    <img src="/images/Btn.PNG" width="90" heght="50" alt="submit" /> 
</button> 
+0

從來沒有見過它的書面的方式。它真的有用嗎?我喜歡它! – Lobo 2010-12-03 08:58:43

1

你可以申請一個樣式的底部或提交HTML標籤,如:

<input type="submit" class="mybotton" value="Continue" /> 

通過這種方式,你可以添加背景圖片:

.mybotton{ 
    background-image: url(buttonimage.png); 
} 

關心!

0

如果u想要的是ü上述相同的設計就用這個

<input type="image" src="submitbutton.png" />