Question

GWT tutorial - StockWatcher.

I am overriding StockWatcher.css:

body {
    padding: 10px;
}

But no padding is applied, at least on the left, and the whole frame is flush to the left side.

Était-ce utile?

La solution

Some panels in GWT use absolute positioning. Applying padding to widgets that are direct children of these panels won't work. In such situations you use, for example,

myLayoutPanel.setWidgetLeftRight(myWidget, 10, Unit.PX, 10, Unit.PX);

You can apply padding and margins to any widget whose parent does not use absolute positioning for its children (e.g. widgets inside FlowPanel or HTMLPanel).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top