O'Reilly logo

jQuery Mobile Cookbook by Chetan K Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a custom icon in a button

Buttons can contain text, icons, or both. The icon can be positioned in one of the four directions within a button. The jQuery Mobile framework provides a set of standard icons that you can use in your app. This recipe shows you how to add a custom icon to a button along with the standard icon provided by the framework.

Getting ready

Copy the full code of this recipe from the code/04/custom-icon sources folder. You can launch this code using the URL http://localhost:8080/04/custom-icon/main.html.

How to do it...

In this recipe, the following image, square.png is used for the custom icon image:

How to do it...
  1. Create a new style sheet ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required