lucemia
lucemia

Reputation: 6627

Why the font size won't change with browser zoom in?

In most of websites, while I change the zoom level of browsers, the font size will also increase and help user to see them. For some reasons, that just won't work on my new website. While I change the zoom level of the browser, everything changes but all font size keep the same. Is there a css or html property that I can use to control this behavior? Thanks

here is an example: http://ca.skywatcher.com/index.php

Upvotes: 14

Views: 32552

Answers (3)

Lycha
Lycha

Reputation: 10187

The problem is that you have set -webkit-text-size-adjust: none; for the body in layout.css. Changing it to -webkit-text-size-adjust: auto; allows the zooming of the fonts along with the page.

Edit: Corrected the CSS. Should be auto not 0

Upvotes: 30

Brian Driscoll
Brian Driscoll

Reputation: 19635

If you're using a fixed-point width for your font-size settings (e.g.: pixels), then your font size will remain unchanged when the user zooms. If you want the font to enlarge or diminish when the user zooms in/out, then consider using em as your unit (1 em = 100% of the default font size on the user's machine).

Upvotes: -1

Glen Solsberry
Glen Solsberry

Reputation: 12320

Fonts using a specific pixel size are not relative (along with several others). Zooming changes that relative information.

From http://www.westciv.com/style_master/academy/css_tutorial/properties/values.html

Name        Abbrev. Explanation                             Relative?
em          em      The height of a font                    yes
ex          ex      The height of the letter x in a font    yes
pica        pc      1 pica is 12 points                     no
point       pt      1/72 of an inch                         no
pixel       px      One dot on a screen                     no
millimeter  mm      Printing unit                           no
centimeter  cm      Printing unit                           no
inch        in      Printing unit                           no

Upvotes: 7

Related Questions