Re: GWT appears to be overriding my css
If you use a stylesheet linked in from your html code, it will get
loaded before the theme stylesheet is loaded, so your styles will get
overwritten. If you put the stylesheet and associated images in a
public folder of your module and reference it in the gwt.xml file (a
la GWT 1.5), it will be added after the theme stylesheet, and thus
override the GWT theme styling.
Another approach is to make your styles more specific than the GWT
styles, for example, html body .gwtDecoratorPanel .topLeft { ... }.
This seems to work in IE7 and FF 3.5. I have seen rules starting with
html>body in various posts, but this does not work in IE for me. My
dissatisfaction with this is that I can see a browser deciding that
the html body doesn't add any specificity to the rule, since that
combination is guaranteed to happen.
Yet another approach is to rely on the implementation of a widget,
with a rule like .gwtDecoratorPanel tr td.topLeft { ... } The problem
with this is that conceivably some day GWT could decide that
positioned divs are better than a table for the DecoratorPanel
implementation.
Perhaps the best approach would be to give the body an id, or use an
id'd div as the RootPanel, and start the css rule with the id.
On Nov 5, 6:23 pm, Rob Tanner <caspersg...@gmail.com> wrote:
> Hi,
>
> I just upgraded Eclipse to Galileo and downloaded the GWT plugin and
> started a new project. I added a customized stylesheet (just adding a
> link in the html) that I use to affect a standardized look and feel.
> At this point (besides the root panel) all I've added is a single
> panel that contains a logo and in my custom stylesheet I define an
> image for the background in a body tag. In hosted mode, it all
> displays correctly. However, when I click on "compile" in the hosted
> display window, what ultimately gets displayed in a regular browser
> does not include the background image.
>
> From the browser, I checked to make sure the link to my custom sheet
> was good and I also used the link in the style sheet to make sure I
> could see the background image. Also, just for grins, I commented out
> the body tag in the standard.cssthat GWT provides. Not only did that
> not make a difference, the act of compiling replaced the standard.css
> file, thus effectively uncommenting the body tag. And finally, I
> tried adding the body tag to the defaultcssfile in the WEB-INF
> folder and it made no difference. The bottom line, it looks like mycssfile is being overridden behind the scenes. That doesn't make a
> lot of sense, but that's what it looks like.
>
> Any ideas.
>
> -- Rob
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home