!important doesn't work to override font-family style. GWT's
standard.css has font-family defined for body, table td, select, so I
just wrote my own definition in my .css file for those same elements
and used my own fonts. That was the only way to gain control again.
Before I did that, the only way to make text have the font-family I
desired was to specify font-family directly in the element (div) that
directly contained the text. It wouldn't work if I set font-family for
a div that contained multiple other divs that each contained text. Not
even if I used !important.

That frustrated me sooo much!

On Jun 16, 2:16 pm, Danny Goovaerts <[email protected]> wrote:
> Magnus,
>
> standard.css is "added" after your style sheets are loaded. Unless
> your style definitions are more selective that the definitions in
> standard.css, the definitions in standard.css take precedence.
> There are to possible solutions
>
> - make your selectors more precise(googleon css priority for detailed
> descriptions, much better that I could do here)
> - mark your style definition as !important, for example, that's how I
> override the settings for .gwt-button
>
> .authenticate-button {
>   background: white none  !important ;
>   margin:2px !important;
>
> }
>
> Danny
>
> On Jun 16, 8:54 pm, Magnus <[email protected]> wrote:
>
>
>
> > Hi Sven,
>
> > I think that's an issue for me. When I use addStyleName with padding/
> > margin, it has no effect. I guess it's overwritten. However, copying
> > the standard.css sounds not nice to me. Isn't there another
> > (programmatical) solution?
>
> > Magnus
>
> > On Jun 16, 1:35 pm, Sven <[email protected]> wrote:
>
> > > Hi Magnus,
>
> > > > So what is the way one should use CSS? Is it possible to "inherit" a
> > > > style into another style, e. g. "my-button" inherits "gwt-Button", so
> > > > that I just add my adjustments?
>
> > > just try to use addStyleName() instead of setStylePrimaryName(). By
> > > this you preserve the default standard.css styling of your elements
> > > and you can add additional formatting. More specific, the button would
> > > still have the class gwt-Button followed by your specific class which
> > > you can add to any CSS file linked in the main page.
>
> > > However, as GWT adds its standard.css as last css file you may still
> > > experience strage overruling of your styles (using Firebug helps to
> > > understand what is overruled by what).
>
> > > If that standard.css overruling is an issue for you, my blog post
> > > "GWT's standard.css killed my page layout" may help you:
>
> > >    
> > > http://ililiililililii.blog.de/2010/05/12/gwt-s-standard-css-killed-m...
>
> > > Sven

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to