How To Specify (Override) JQuery Icon Color

后端 未结 6 620
無奈伤痛
無奈伤痛 2020-12-12 19:37

I\'ve been making good use of the jQuery icons in my web app, but have come to a point where I would like to use a color that I\'m not able to achieve by default. I\'m curre

6条回答
  •  攒了一身酷
    2020-12-12 20:10

    SELF-ANSWER: Specified the background-image URL myself to be the file that uses the white icons. So I added a few lines to my CSS file:

    .dialog #errorMessage .ui-icon
    {
        background-image: url(../../CSS/themes/custom_green/imag/ui-icons_ffffff_256x240.png);
    }
    

    This essentially overrides the background image that the default jQuery css file wants to use for the icon, and achieved the color that I wanted. Of course this only worked because a white icon .png file was included with the theme. If I wanted some crazy color, like purple, I would have needed to create my own icon(s). Note that I needed to lengthen the URL in my own CSS file versus the URL that is specified in the jQuery CSS file, because they're located in two different places in my source.

提交回复
热议问题