Wrong font size when using float right in CSS on Mobile Safari

荒凉一梦 提交于 2019-12-05 20:21:37

Have tried using another method of positioning the text within the span elements? One method you can try is position: absolute; right: 0; on that span element and see if iOS renders it with the auto-resizing. I tried testing this within the iOS simulator and all text were identical in size.

Here's the jsFiddle for the code that I tested: http://jsfiddle.net/AntLm/3/

WebKit has an annoying function (for a properly designed responsive site) of trying to enlarge the font for the "primary" text on the screen, where primary is simply it's best guess. Once you float some text, it is no longer considered "primary" content, so it does not have the auto-zooming applied to it.

You can disable this behavior with:

body {
    text-size-adjust: 100%; 
    -ms-text-size-adjust: 100%; 
    -moz-text-size-adjust: 100%; 
    -webkit-text-size-adjust: 100%;
    }

This is still an experimental property.

You should use this in conjunction with a responsive design that scales the contents appropriately for users of small-screen devices.

Note: Do not use none; that trips a bug in older webkit desktop browsers which causes them to disable text zooming.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!