如何在jQuery Mobile中将图像用作按钮?

Sah*_*ver 4 css image button jquery-mobile

我经历了一个关于如何用自定义图像替换jQuery Mobile中的默认按钮的搜索,因为我正在实现构建PhoneGap应用程序的代码.我发现这个有用的链接.

我有这样的代码:

<a href="#user_info" data-role="button" data-theme="b" data-iconpos="right" data-icon="myapp-custom">Custom Icon</a>
Run Code Online (Sandbox Code Playgroud)

CSS是:

.ui-icon-myapp-settings {
  background: url("settings.png") no-repeat rgba(0, 0, 0, 0.4) !important;
}
Run Code Online (Sandbox Code Playgroud)

它仍显示+图标,而不是我的图标.

css directory -- ../css/style.css
image directory  ../css/images/settings.png
Run Code Online (Sandbox Code Playgroud)

我得到的观点如下:

代码或图像位置有什么问题?

小智 12

如果你需要的东西比大图标,以使用图像,作为一个按钮,只需使用以下命令:

<a href="venta.html" data-theme="" id="ventaOption"> <img src="css/images/standard/shoppingcart.png" width="26" height="26"> <br/> Ventas </a>