1

I´ve tried to use a jQuery Ui button with an image. So i wrote the following code:

$("#analyse_button").button({ icons: { primary: "fb-icon" } });

.fb-icon {
    background-image: url(./fb-icon.png);
}

As you see in the screenshot below the background-image is overriden by the standard ui-icon background-image but even if i remove this my image is still not being displayed.

See Image here

Am i doing anything wrong?

1 Answer 1

0

In order to increase the priority of your CSS rule it should be defined this way:

.ui-state-default .fb-icon {
    background-image: url(./fb-icon.png);
}
Sign up to request clarification or add additional context in comments.

4 Comments

so that worked now its no longer overriden but its still not displaying.. any others ideas?
Try to adjust the position of the image with background-position.
that worked too (; now one last question: how to i resize the icon?
You can use background-size property, but it's not supported in IE<9, so better to use already sized icon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.