这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

text-size-adjust CSS property controls the text inflation algorithm used on some smartphones and tablets. Other browsers will ignore this property.

/* Keyword values */
text-size-adjust: none;
text-size-adjust: auto;
/* <percentage> value */
text-size-adjust: 80%;
/* Global values */
text-size-adjust: inherit;
text-size-adjust: initial;
text-size-adjust: unset;
					

Because many websites have not been developed with small devices in mind, mobile browsers differ from desktop browsers in the way they render web pages. Instead of laying out pages at the width of the device screen, they lay them out using a viewport that is much wider, usually 800 or 1000 pixels. To map the extra-wide layout back to the original device size, they either show only part of the whole render or scale the viewport down to fit.

Since text that has been scaled down to fit a mobile screen may be very small, many mobile browsers apply a text inflation algorithm to enlarge the text to make it more readable. When an element containing text uses 100% of the screen's width, the algorithm increases its text size, but without modifying the layout. The text-size-adjust property allows web authors to disable or modify this behavior, as web pages designed with small screens in mind do not need it.

句法

text-size-adjust property is specified as none , auto ,或 <percentage> .

none

Disables the browser's inflation algorithm.

auto
Enables the browser's inflation algorithm. This value is used to cancel a none value previously set with CSS.
<percentage>

Enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size.

形式定义

初始值 auto for smartphone browsers supporting inflation, none in other cases (and then not modifiable).
适用于 所有元素
继承 yes
百分比 yes, refer to the corresponding size of the text font
计算值 如指定
动画类型 discrete

形式句法

none | auto | <percentage>
					

范例

Basic disabling usage

As hinted at above, on a properly designed responsive site the text-size-adjust behavior is not needed, so developers can elect to turn it off by specifying a vlaue of none:

p {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
					

规范

规范 状态 注释
CSS Mobile Text Size Adjustment Module Level 1
The definition of 'text-size-adjust' in that specification.
编者草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
text-size-adjust Experimental Chrome 完整支持 54
完整支持 54
不支持 No Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -webkit-
注意事项 Instead of ignoring the -webkit-text-size-adjust property, a bug prevents desktop Chrome users from zooming in or out. The bug was fixed after Chrome 26.
Edge 完整支持 79
完整支持 79
不支持 12 — 79 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Firefox 不支持 No IE 不支持 No Opera 完整支持 41 Safari 不支持 No
不支持 No
不支持 No Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -webkit-
注意事项 Instead of ignoring the -webkit-text-size-adjust property, a bug prevents desktop Safari users from zooming in or out. The bug was fixed after Safari 5.
WebView Android 完整支持 54 Chrome Android 完整支持 54 Firefox Android 完整支持 49 Prefixed
完整支持 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
完整支持 14 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
preference (needs to be set to ). To change preferences in Firefox, visit about:config.
Opera Android 完整支持 41 Safari iOS 完整支持 1 Prefixed
完整支持 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Samsung Internet Android 完整支持 6.0
<percentage> Experimental Chrome 完整支持 54 Edge 完整支持 12 Firefox 不支持 No IE 不支持 No Opera 完整支持 41 Safari 不支持 No WebView Android 完整支持 54 Chrome Android 完整支持 54 Firefox Android 不支持 No Opera Android 完整支持 41 Safari iOS 不支持 No Samsung Internet Android 完整支持 6.0

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

见实现注意事项。

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改:
  1. CSS
  2. CSS 参考
  3. CSS Text
  4. 特性
    1. hanging-punctuation
    2. hyphens
    3. letter-spacing
    4. line-break
    5. overflow-wrap
    6. paint-order
    7. tab-size
    8. text-align
    9. text-align-last
    10. text-indent
    11. text-justify
    12. text-size-adjust
    13. text-transform
    14. white-space
    15. word-break
    16. word-spacing

Copyright  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1