0

I have the following CSS class declared for my base root panel.

#rootPanel
{
width: 100%;
height: 100%;
background-image:url("../images/green013.jpg");
}

My widgets are all positioned using %ages so they appear in the centre of the viewpanel regardless of the width of the Screen. Problem is with my background image. It doesn't repeat to fill the background which it does fine if I set my root panel dimensions to be say 800px and 800px. Seems it doesn't repeat if I use %ages for some reason? Any ideas what might be wrong?

MayoMan
  • 4,757
  • 10
  • 53
  • 85

2 Answers2

0

yes, you are right. image is not repeat in %. for repeat image, you have to specify height & width in Pixel. I am facing same problem when I set into pixel, it will work!!.

bNd
  • 7,512
  • 7
  • 39
  • 72
  • Hmmm, setting pixel width is not an option as I want my UI to look similar regardless of the width of the UI – MayoMan Mar 19 '13 at 14:36
  • you can do it by using `Window.getClientWidth() + "px" `. is there any issue with it!! or you can do such as refer:http://stackoverflow.com/questions/2083831/css-background-image-does-not-fill-when-scrolling – bNd Mar 19 '13 at 14:38
0

If you want to get rid off the % height and width and set them in Pixel regardless of the browser size ,then use

RootPanel.get().setHeight(Window.getClientHeight()+"px"); 

RootPanel.get().setWidth(Window.getClientWidth()+"px");

Then apply your style.

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307