Fellrad
Posts: 0
Joined: Wed Oct 15, 2014 9:06 am

Custom Background Image on Button not showing

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

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

Custom Background Image on Button not showing

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...

Fellrad
Posts: 0
Joined: Wed Oct 15, 2014 9:06 am

Custom Background Image on Button not showing

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Custom Background Image on Button not showing

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.

Return to “Issues”