vincentvanjoe
vincentvanjoe

Reputation: 767

GWT - Style CaptionPanel title as bold

What is the best way to style a CaptionPanel title as bold? I was hoping I could apply a CSS style. I'm currently doing:

CaptionPanel examplePanel = new CaptionPanel();
examplePanel.setCaptionHTML("<b>CaptionPanel Title</b>");

Upvotes: 0

Views: 1434

Answers (1)

kgautron
kgautron

Reputation: 8273

The captions are translated in HTML legend elements. So use CSS to set legend elements font as bold.

If you want it on all captions, simply do :

legend {
  font-weight: bold;
}

But if you want it only for a specific CaptionPanel, you add a style name to it :

examplePanel.addStyleName("examplePanelStyleName");

and use the panel style name in the CSS :

.examplePanelStyleName legend {
   font-weight: bold;
}

Upvotes: 3

Related Questions