HTML按钮到图像

时间:2013-11-27 02:48:10

标签: button

我有这段代码<input type="submit" value="Register" /> 我如何插入

<img src="http://i.imgur.com/m9KT9CQ.png" 
onmouseover="this.src='http://i.imgur.com/T9hpI23'" 
onmouseout="this.src='http://i.imgur.com/m9KT9CQ.png'"/>

到这个按钮上?谢谢!

2 个答案:

答案 0 :(得分:0)

看一下这个链接

http://screwdesk.com/how-to-create-html-rollover-image-button-using-css/

基本上就是这个css

a.btn {
display: block;
width: 294px;
height: 87px;
cusror: pointer;
background-image: url(rollover-image-button-1.png);
text-indent: -9999em;
}
a.btn:hover {
background-image: url(rollover-image-button-2.png);
}

答案 1 :(得分:0)

使用此代码:

<button type="submit">
    <img src="http://i.imgur.com/m9KT9CQ.png" onmouseover="this.src='http://i.imgur.com/T9hpI23'" onmouseout="this.src='http://i.imgur.com/m9KT9CQ.png'"/>
</button>