On 3 juil, 17:58, hezjing <
hezj...@gmail.com> wrote:
> Hi
> I want to customize the color and font size of the StackPanel item, so I
> defined the following style:
>
> .mymenu .gwt-StackPanelItem {
> color: blue;
> font-size: small;
>
> }
>
> Then I add the above style and keep the rest of the standard CSS properties:
>
> StackPanel panel = new StackPanel();
> panel.addStyleName("mymenu");
>
> The problem is this only works if I include the CSS in the module XML file.
>
> If I include the CSS in the HTML host page, the style is overridden by
> standard.css.
[...]
> Do you know why including the CSS in the module XML or HTML host page
> affects the output?
The stylesheets in the <module>.gwt.xml are injected at the end of the
document's <head> once the document's <body> is fully loaded, so they
always come *after* the stylesheets found in the HTML, and therefore
override their declarations.