【发布时间】:2013-08-13 06:12:12
【问题描述】:
我正在尝试将图像用作按钮:
<button name="foo" type="button" value="bar" onclick="AjaxResponse()" > <img src="img.png"> </button>
或
<button name="foo" type="button" value="bar" onclick="AjaxResponse()" img src="img.png" />
两者都不显示带有图像的按钮。它只显示小图标,单击时执行正确操作。但是为什么看不到图片呢?
【问题讨论】:
-
为什么不直接用
background-image在CSS中做呢。 -
你确定你的图片路径正确吗?
-
使用输入类型图片w3schools.com/tags/att_input_src.asp。而且您的两个html代码都不正确。
-
Karimkhan,你试过这个吗? stackoverflow.com/questions/2738920/…