I use jQuery icons in my asp.net mvc project. Usually I use gray icons but now I would like a white icon for my blue button (see below).
Here is the code I used:
$(".editUser").button({ icons: { primary: "ui-icon-pencil"} });
$(".deleteUser").button({ icons: { primary: "ui-icon-trash"} });
How can I change the icon color to white?
Thanks
To change the color of the icon, we will use a jquery method. jQuery css() method this method is used to change the styling of a particular selector. This method is also can be used for changing the color of the icon.
you can play around with the sprite used on that icon set:
White Icon Set (ui-icons_ffffff_256x240.png)
Store that sprite somewhere, then reference it in a style sheet you can apply to the blue buttons:
.ui-icon-white {
background-image: url("images/ui-icons_ffffff_256x240.png");
}
Then when you want a white icon set, apply that style:
<span class="ui-icon ui-icon-white ui-icon-pencil"></span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With