2010-12-03 126 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" />