1

I have a html panel and i want to add the html panel to browser screen hence i used rootPanel.get().add(htmlPanel);. But their is a extra space between the starting of the screen and the first widget in html panel (As in image). I tried with setting rootPanel.get().setheight("100%") and rootPanel.get().setsize("100%","100%") but it doesn't seem to work please help i want to remove the extra space and so that the widget starts from beginning.

enter image description here

RAS
  • 8,100
  • 16
  • 64
  • 86
Ekata
  • 259
  • 2
  • 7
  • 21
  • 2
    Did you inspect that "extra space" with your browser's Dev Tools? You're adding the `htmlPanel` at the _end_ of the `RootPanel.get()` (i.e. the `` element), so have a look what you already have in there. – Thomas Broyer Jul 15 '13 at 10:15
  • yes its automatically adding a padding of 50px can u please tell me how can i remove it – Ekata Jul 15 '13 at 10:22
  • Which element the padding is added to? what's the selector that adds it? and which stylesheet does it come from? The Dev Tools should give you all the needed information to debug that issue. – Thomas Broyer Jul 15 '13 at 10:34
  • Its adding padding to the body element in gwt-bootstrap css and every time when i war is generated this is re-created hence im not able to change the css property – Ekata Jul 15 '13 at 10:44

1 Answers1

3

This padding is added by GWT Bootstrap for its NavBar widget. See the note in the javadoc:

NOTE: We assume that most people will use the ResponsiveNavbar, so, we automatically add a padding-top: 50px in body.If you don't want this, you have to put a padding-top: 0px; manually in your document body tag.

See also https://github.com/gwtbootstrap/gwt-bootstrap/issues/120

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164