+201223538180

Web site Developer I Advertising I Social Media Advertising I Content material Creators I Branding Creators I Administration I System SolutionYour CSS reset wants text-size-adjust (most likely) | CSS-Methods

Web site Developer I Advertising I Social Media Advertising I Content material Creators I Branding Creators I Administration I System SolutionYour CSS reset wants text-size-adjust (most likely) | CSS-Methods

Web site Developer I Advertising I Social Media Advertising I Content material Creators I Branding Creators I Administration I System Answer

Kilian Valkhof:

[…] Cellular Safari will increase the default font-size once you swap a web site from portrait to panorama. On telephones that’s, it doesn’t do it on iPad. Safari has been doing this for a very long time, as a method to enhance readability on non-mobile optimized web sites. Whereas undoubtedly helpful in a time when actually no web site was optimized for cellular, it’s considerably much less useful these days. […] Textual content measurement rising randomly in a single state of affairs is precisely the kind of factor you wish to guard for with a CSS reset.

That is very actually what text-size-adjust does. MDN:

When a component containing textual content makes use of 100% of the display’s width, the algorithm will increase its textual content measurement, however with out modifying the structure. The text-size-adjust property permits net authors to disable or modify this habits, as net pages designed with small screens in thoughts don’t want it.

You may see Apple’s personal docs exhibiting off that is precisely what they do (on iPhones). There’s an historical bug the place this could forestall zooming, however most likely not an enormous concern anymore.

Kilian’s advice:

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

Firefox doesn’t even help it, so I’d possibly lose that vendor prefix, however in any other case I’d say I’m on board. I’d prefer to assume I can deal with my very own textual content sizing.

Jogs my memory of how Cellular Safari does that zooming factor with textual content inputs underneath 16px, so be careful for that too.


Direct Hyperlink →

Supply hyperlink

Leave a Reply