Add image to button

Someone help me. How to add an image to a button? I use the following code to create a button. I want to display the image instead of "Refresh". Is it possible to do this? Thanks in advance.

<div data-role="button" data-iconpos="right" id="searchResultRefresh" data-icon="refresh"> 
 refresh </div>
+3
source share
2 answers

You are interested in this document:

http://jquerymobile.com/demos/1.0a2/#docs/buttons/buttons-icons.html

Custom icons are listed below. Take one of the existing ui-icon-sth classes and change the offsets to refer to the end of the icon file, and then add your icon there if you want to reuse it.

If not, just change the link to the image in the copied CSS and delete the background position definition.

+3
source

, div.

, HTML:

<button type="button"><img src="Refresh.gif" /></button>
+1

Source: https://habr.com/ru/post/1786331/


All Articles