Page 1 of 1

Custom Background Image on Button not showing

Posted: Wed Mar 18, 2015 10:42 am
by Fellrad

Hi there!

I want to place a custom background into a button. It worked when I used the theme. However, I'd rather like to use a css-file to do this. I have the problem that my css-code is not recognized by the browser, i.e. no Background Image was shown, although all other attributes work. Do you have a clue why this could be the case?

Here are two screenshots.

Image Image


Custom Background Image on Button not showing

Posted: Wed Mar 18, 2015 11:17 am
by Egor Kotov6832188

Hi Fellrad,

Probably, your css rules 'weak' from the CSS point of view.
Next doc will help to understand your mistake
https://css-tricks.com/specifics-on-c...


Custom Background Image on Button not showing

Posted: Thu Mar 19, 2015 8:21 am
by Fellrad

Hi Egor,

Thank you for the link. However, I have put an "!important" behind the code lines. As you can see in the second image above, the background property was not overwritten. All other button manipulations work totally fine.


Custom Background Image on Button not showing

Posted: Mon Mar 23, 2015 4:34 am
by Yurii Orishchuk

Hi Fellrad,

It seems you have incorrect url to the image.

Please try following css code:

pre

/* replace "aaaaaa" with your button className */
.aaaaaa{
background-image: url(https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTmVA7LKJeNGfSooZQBT1iPJ5RH_cVu_iZwEkKsB3px-1P_qwftdUTTdxM) !important;
}

/pre

Regards.