使用jQuery UI图标 [英] Using jQuery UI icons
问题描述
jQuery UI在sprite图像中带有方便的图标;参见 themeroller .
jQuery UI comes with handy icons in a sprite image; see the themeroller.
我有一个input
元素,我希望将其时钟图标(类为.ui-icon-clock
)作为背景图像.如何在input
上显示背景图标?
I have an input
element for which I want the clock icon (with class .ui-icon-clock
) as background image. How do I have a background icon to an input
?
推荐答案
只需使用一个空跨度并添加jQuery UI类.
just use an empty span and add the jQuery UI classes.
<span class="ui-icon ui-icon-clock" style="display:inline-block"></span><input type="text" />
您必须重写显示样式以使其成为行内阻止而不是阻止,否则输入将被推到下一行.
You have to override the display style to make it inline-block rather than block otherwise the input will be pushed to the next line.
除此之外,当您说将时钟设置为背景图像时,我不确定您的要求.
Other than that, I'm not sure exactly what you're after when you say make the clock the background image.
这篇关于使用jQuery UI图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!