Question

i wrote css for a button its working fine in GWT designer and it showing the image. but when i compile and run its not showing the image . and i tried getElement().getStyle() but no use i tried DOM.setStyleAttribute(btnNewButton.getElement(), "background", "url(../WEB-INF/btn.jpg)"); no use

please help me with this..

here's my css

.cancel {
    background-repeat: no-repeat;

    background-image: url( ../WEB-INF/btnCancel.jpg);

}

code..

Button btnNewButton = new Button("New button");

btnNewButton.setStyleName("cancelbutton");

btnNewButton.setText("cancel");

i am using GWT 2.4

Was it helpful?

Solution

Don't put files in the WEB-INF folder if you want to access them in a web page. The folder is not accessible.

OTHER TIPS

Try using quotes in css.

background-image: url('../WEB-INF/btnCancel.jpg');

Should be a good matter. And make sure the image is not called 'btnCancel.JPG'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top