How to correct IE font size problem?

2,969 views
Skip to first unread message

lembas

unread,
Mar 3, 2010, 6:35:21 AM3/3/10
to Google Web Toolkit
Font size is larger in IE than the Firefox and Chrome. All labels,
buttons, flextables, grids, tabs...
Everything is like ~20% larger in IE. My IE version is 8. I have tried
all versions of GWT between 1.6 and 2.0.3, all of them have the
problem. I do not use UIBinder or any new layout widgets in GWT2.

In CSS I tried *{font-size:80%} only works for few widgets and does
not affect girds,tabs and flextables.

Is there a solution? How to maintain the same font size for all
widgets in IE and Firefox/Chrome?

Mike

unread,
Mar 3, 2010, 8:30:16 AM3/3/10
to Google Web Toolkit
Dear Iembas,

I ran into this problem as well recently, As far as I understand, the
cause is that many browsers have predefined default styles. If you
reset those prior to applying your own style, the looks of your page
will be more uniform across browsers. See

meyerweb.com/eric/tools/css/reset/
meyerweb.com/eric/tools/css/reset/

Hope that helps.

Bye, Mike

Gabriel Guerrero

unread,
Mar 3, 2010, 9:37:02 AM3/3/10
to Google Web Toolkit
Hi Iembas

The way I solved is using the GWT CssResorce
you can do stuf like
@if !user.agent ie6 {
...
}
for special style for IE in your css

I recommend you to read
http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#CssResource

Cheers
Gabriel

lembas

unread,
Mar 4, 2010, 7:05:08 AM3/4/10
to Google Web Toolkit
Gabriel: CssResource can solve the problem but not easily. I will look
at it when I have time. Thanks.

Mike: I tried your method. It is easy. But IE still has fonts on
buttons,grids,flextables...

I am not interested in margins or paddings. Even my gmail inbox looks
different on different browser, but it has the same font size on all.

I even tried the following but font-size does not change on
buttons,grids,flextables...
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
font-size: 10px;
}

On Mar 3, 4:37 pm, Gabriel Guerrero <gabrieldavidguerr...@gmail.com>
wrote:


> Hi Iembas
>
> The way I solved is using the GWT CssResorce
> you can do stuf like
> @if !user.agent ie6 {
>   ...}
>

> for special style forIEin your css
>
> I recommend you to readhttp://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm...


>
> Cheers
> Gabriel
>
> On Mar 3, 1:30 pm, Mike <mcwe...@gmail.com> wrote:
>
> > Dear Iembas,
>
> > I ran into this problem as well recently, As far as I understand, the
> > cause is that many browsers have predefined default styles. If you
> > reset those prior to applying your own style, the looks of your page
> > will be more uniform across browsers. See
>
> > meyerweb.com/eric/tools/css/reset/
> > meyerweb.com/eric/tools/css/reset/
>
> > Hope that helps.
>
> > Bye, Mike
>
> > On Mar 3, 12:35 pm, lembas <keremo...@gmail.com> wrote:
>

> > >Fontsize is larger inIEthan the Firefox and Chrome. All labels,
> > > buttons, flextables, grids, tabs...
> > > Everything is like ~20% larger inIE. MyIEversion is 8. I have tried

Sorinel C

unread,
Mar 4, 2010, 3:57:08 PM3/4/10
to Google Web Toolkit
Are you sure isn't it the IE8 option "Page ~ Zoom" set to 150% instead
100% ?

Cheers!

jaga

unread,
Mar 10, 2010, 11:17:16 AM3/10/10
to Google Web Toolkit
Hi,

I solved this by setting the XML Doc Type to Standards mode. GWT sets
this to quirks mode by default. A quick fix but may have far reaching
consequences to how your app's look and feel. Look in your
application's HTML file and set this at the top.

Cheers,

Jaga

Thad

unread,
Mar 10, 2010, 12:27:15 PM3/10/10
to Google Web Toolkit
I was having font and other alignment issues until--on advice from
someone here--I switched to strict mode:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">

This has been very helpful, and I've not noticed any problems with it.

You might also see http://hsivonen.iki.fi/doctype/ for a discssion of
browser modes and doctype.

lembas

unread,
Mar 11, 2010, 2:09:21 AM3/11/10
to Google Web Toolkit
I have tried strict mode and loose mode but had some layout problems
with them.

I have managed to fix the font size by:

.gwt-Button {
font-size: 14px !important;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {

font-size: 14px !important;
}

On Mar 10, 7:27 pm, Thad <thad.humphr...@gmail.com> wrote:
> I was havingfontand other alignment issues until--on advice from


> someone here--I switched to strict mode:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
> TR/html4/strict.dtd">
>
> This has been very helpful, and I've not noticed any problems with it.
>

> You might also seehttp://hsivonen.iki.fi/doctype/for a discssion of

justanotherpg

unread,
Feb 16, 2020, 2:03:42 PM2/16/20
to GWT Users
I know this is old stuff.. but just had to say..  the page zoom worked fine for me..  Yes, fonts vary per browser, but when your talking 20% bigger.. then check the page zoom...just saying
Reply all
Reply to author
Forward
0 new messages