Creating a button in jQuery Mobile with a custom icon

I am working on a client application and am trying to create a button with a fully customizable icon. 30px x 30px icon and transparent in the middle.

I almost reached what I want using this css code:

/* info button override */
.ui-icon-info-page {
    background: url(images/G_help_icon_round.png) 50% 50% no-repeat;
    background-size: 30px 30px;
    background-color: black;
}

But a thin black circle appears inside the icon, and the image of the icon is cropped:

enter image description here

I want to delete this circle and prevent the icon? from circumcision. In addition, I would like the question mark to be transparent, not black, to show the image of the navigation bar below. If I try to set the background color to transparent, the button looks completely white:

enter image description here

How can i do this?

Update:

I tried applying this code:

/* info button override */
.ui-icon-info-page {
    background: url(help.png) 50% 50% no-repeat;
    background-size: 30px 30px;
    width: 30px;
    height: 30px;
    margin-top: -15px !important;
    box-shadow: none;
    -webkit-box-shadow: none;
}

And got this result:

enter image description here

, , :

enter image description here

2:

, ( , , ):

enter image description here

html, :

<div data-role="header" data-position="fixed"> 
            <div><img border="0" src="images/G_iphone_navbar_logo.png" style="display:inline;"/> </div>          
            <a href="index.html" data-icon="refresh" class="ui-btn-left" data-transition="fade" data-iconpos="notext" data-theme="a"></a>
            <a href="info.html" data-icon="info-page" class="ui-btn-right" data-transition="flip" data-iconpos="notext" data-theme="a"></a>

</div>
+3
1

/* info button override */
.ui-icon-info-page {
    background: url(help.png) 50% 50% no-repeat;
    background-size: 30px 30px;
    width: 30px;
    height: 30px;
    margin-top: -15px !important;
    box-shadow: none;
    -webkit-box-shadow: none;
}

, , css jquery mobile css.

: , , .

<!DOCTYPE html>
<html>
    <head>
        <title>Page Title</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
        <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
        <style>
            #rightBtn .ui-btn-inner {
                width: 30px;
                height: 30px;
                margin: -3px;/*Modify to change icon position wrt the header*/
                border: none !important;
            }
            .ui-icon-custom {
                background: url(http://i.stack.imgur.com/AqicD.png) 50% 50% no-repeat;
                background-size: 30px 30px;
                width: 30px;
                height: 30px;
                box-shadow: none;
                -webkit-box-shadow: none;
                margin: 0 !important;
            }
        </style>
    </head>
    <body>
        <div data-role="header">
            <h1>Page Title</h1>
            <a href="index.html" data-icon="refresh" class="ui-btn-left" data-transition="fade" data-iconpos="notext" data-theme="a"></a>
            <a href="info.html" id="rightBtn" data-icon="custom" class="ui-btn-right" data-transition="flip" data-iconpos="notext" data-theme="a"></a>
        </div><!-- /header -->

        <div data-role="content"></div><!-- /content -->

        </div><!-- /page -->

    </body>
</html>

- http://jsfiddle.net/LCsmt/

, .

+7

All Articles