Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Created March 23, 2016 10:16
Show Gist options
  • Select an option

  • Save hsleonis/c72bb1084567a0892a3a to your computer and use it in GitHub Desktop.

Select an option

Save hsleonis/c72bb1084567a0892a3a to your computer and use it in GitHub Desktop.
Mobile Safari on iPhone will automatically increase the size of small text.The work around is ‑webkit‑text‑size‑adjust: 100%
/*
On mobile devices, the text-size-adjust property allows Web authors to control if and how
the text-inflating algorithm is applied to the textual content of the element it is applied to.
As this property is non-standard, it must be used prefixed: -moz-text-size-adjust,
-webkit-text-size-adjust, and -ms-text-size-adjust.
Reference:
http://blog.55minutes.com/2012/04/iphone-text-resizing
http://davemacaulay.com/webkit-text-size-adjust-doesnt-work-on-android-chrome
*/
p {
/* Text is never inflated */
text-size-adjust: none;
/* Text may be inflated */
text-size-adjust: auto;
/* Text may be inflated in this exact proportion */
text-size-adjust: 80%;
/* Global values */
text-size-adjust: inherit;
text-size-adjust: initial;
text-size-adjust: unset;
/* iOS, practical use */
-webkit-text-size-adjust: 100%; /* [chrome] */
-ms-text-size-adjust: 100%; /* [IE] */
/* Android chrome, use max-height: 5000em; on parent; */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment