ton123123,
The intent is to prevent CSS namespace pollution. It is common
practice to use a makeshift namespace for your CSS selectors so as not
to break existing CSS selectors. Say for example you had a rule for
".closeButton" . If anyone else used that selector in their module,
you might be overriding and breaking their CSS. So, you use a
makeshift namespace. Let's say everything in your module is inside a
container, then you could make that selector
".myModuleContainer .closeButton" and now it will only apply to your
module and not break any others.
This is why ".gwt-MenuBar .gwt-MenuItem" is used. There could be ".gwt-
MenuItem" items that appear in places other than the menubar, so use
this more specific selector to only apply to the menu items of
interest.
A better step is to use the CSSResource feature of GWT, and then
you'll never need to worry about these collisions as each selector can
have a unique name, and your CSS will parse faster.
https://code.google.com/p/google-web-toolkit/wiki/CssResourceCookbook
Hope that helps.
Sincerely,
Joseph
On Feb 29, 10:43 pm, tong123123 <
tong123...@gmail.com> wrote:
> in gwt developer guildehttp://
code.google.com/webtoolkit/doc/latest/DevGuideUiCss.html