WelcomeTo
WelcomeTo

Reputation: 20571

Add CSS to GWT widget

How add some style only to GWT container, not to all widget that container contains? For example I need to style CaptionPanel's caption (make it bigger and change color). But when I add style to entire CaptionPanel then all widgets inside inherits added style too.

Upvotes: 0

Views: 450

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64541

CSS 101: restrict your style to the legend element that's a child of the CaptionPanel. E.g.

myCaptionPanel.addStyleName("foo");
.foo > legend { color: red; }
/* use ".foo legend" above, without the ">" if you need to support IE6 */

Upvotes: 1

Related Questions