Hi All,
I’m trying to put different labels in a CssLayout the problem that label wasn’t taken the setted margin.
Here’s what i wrote:
private Component productSettingsLabel = new Label();
CssLayout layoutRight = new CssLayout() {
@Override
protected String getCss(Component c) {
return "margin-top: 8px; margin-left: 8px";
}
}
layoutRight.addComponent(productSettingsLabel);
productSettingsLabel.setCaption("Product settings");
The specified margins are not applied on the label.
Here’s what i get when i inspect the added text with firebug:
<div class="v-caption v-caption-searcher-title">
<div class="v-captiontext">Product settings</div>
<div class="v-caption-clearelem"></div>
</div>
A blank horizontal line is displayed under the label here’s its inspection result:
<div class="v-label v-label-searcher-title
searcher-title" style="margin-top: 8px; margin-left: 8px; width: 434px;"> </div>
So the caption is seperated from the label. And since the caption is not considered as a “Component” (in the overrided getCss() method), the style was not applied on it.
I tried to add the “display: inline-block;” to the used style. but it didn’t work for me.
I hope i gave all the details.