Html 如何在提交按钮上显示图像?

Html 如何在提交按钮上显示图像?,html,css,button,submit,background-image,Html,Css,Button,Submit,Background Image,我有一个提交按钮,我想在该按钮上显示一个图像(a.jpg),但不会显示提交按钮的值。在“提交”类型按钮的情况下是否可能?(不是“type='image') -谢谢。 <button type="submit" name="foo" value="bar"> <img src="image.png" alt="submit"> </button> 您可以使用CSS适当地设置按钮样式 ​<input id="it" type="submit"


我有一个提交按钮,我想在该按钮上显示一个图像(a.jpg),但不会显示提交按钮的值。在“提交”类型按钮的情况下是否可能?(不是“type='image')


-谢谢。


<button type="submit" name="foo" value="bar">
    <img src="image.png" alt="submit">
</button>

您可以使用CSS适当地设置按钮样式

​<input id="it" type="submit" value="Submit">​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

您尝试过使用
吗?为什么不使用
type=“image”
并在点击事件中提交表单?在“提交”类型按钮的情况下不可能吗?按钮type=“提交”会给您更多的自由度,只要您不需要“在后端提交”的值(一些较旧的浏览器不支持按钮标记的值。我尝试了“”,但没有在mozilla firefox最新版本上使用此选项存在跨浏览器问题,例如在ipad中
​<input id="it" type="submit" value="Submit">​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
​#it{
    background-image:url(http://placehold.it/50x50);
    font-size:0;
    width:50px;
    height:50px;
}​