Jquery mobile 如何使用jQuery Mobile将图像居中放置在按钮内?

Jquery mobile 如何使用jQuery Mobile将图像居中放置在按钮内?,jquery-mobile,Jquery Mobile,我是jQuery mobile和Phonegap的新手。对不起,如果这里不是问这个问题的地方 我试着把一个自定义图像放在一个按钮内(不是左边或右边的小图标,而是一个更大的图像) 我使用以下代码: <a data-role="button" data-corners="false" data-shadow="false" > <img src="images/car.png" /> </a> #mybutton { background: ur

我是jQuery mobile和Phonegap的新手。对不起,如果这里不是问这个问题的地方

我试着把一个自定义图像放在一个按钮内(不是左边或右边的小图标,而是一个更大的图像)

我使用以下代码:

<a data-role="button" data-corners="false" data-shadow="false" >
    <img src="images/car.png" />
</a>
#mybutton {
    background: url('car.png') no-repeat scroll 0 0 transparent;
    background-position: center center; 
}
任何帮助都将不胜感激(我花了整整一个晚上试图解决这个问题)


提前感谢。

您可以尝试将图像设置为链接的
背景,并使用
背景位置:居中

HTML:

<a id="mybutton" data-role="button" data-corners="false" data-shadow="false" >&nbsp;</a>

您可以尝试将图像设置为链接的
背景
,并使用
背景位置:居中来居中

HTML:

<a id="mybutton" data-role="button" data-corners="false" data-shadow="false" >&nbsp;</a>

试着用这个东西,像这样:



祝你好运

试着用这个东西,像这样:


祝你好运

      <button><img src="http://doc.jsfiddle.net/_downloads/jsfiddle-logo.png" height=35 width=35 ></button>