1

I'm using Jquery mobile icons. I have a little confusion here to change the actual icon color to red and background to white. See below html code.

<div data-role="page"><div data-role="content">
<a href="#" data-role="button" data-icon="home" data-inline="true" data-iconpos="notext">  </a</div></div>

Such that the icon should be as follows

Icons should be like this

See JS FIDDLE HERE

Murali N
  • 3,451
  • 4
  • 27
  • 38

1 Answers1

-1

You need to add a data-theme attribute, and you can create themes using jQuery Mobile themeroller. Here is the fiddle with a different color.

     <a href="#" data-role="button" data-icon="home" data-inline="true" data-iconpos="notext" data-theme="b"></a></div>

If you don't want to create your own themes for jQuery Mobile, then use an inspector and find the right element, then add css to it. For example:

.ui-btn-icon-notext .ui-btn-inner .ui-icon {
      background-color: #111;
 }

Update: You have to create your own icon and then change the icon background image:

.ui-btn-icon-notext .ui-btn-inner .ui-icon {

    background: url(http://png.findicons.com/files/icons/2165/office/48/home_01.png);
    background-size: 17px;

}
Faridoon
  • 154
  • 2
  • 4
  • 8