For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/css/properties/-x-auto-font-size-line-ranges.md.
Lynx
  • 简体中文
  • -x-auto-font-size-line-ranges

    介绍

    -x-auto-font-size-line-ranges 属性为文本字号自适应定义基于行数的字号范围规则。它需要与 -x-auto-font-size: true 配合使用,用于为不同的实际渲染行数指定不同的字号搜索区间。

    使用示例

    语法

    -x-auto-font-size: true;
    -x-auto-font-size-line-ranges:
      line-range(1, 18px, 22px), line-range(2, 16px, 18px),
      line-range(3 to infinity, 14px);

    取值

    • line-range(<line-count>, <min-size>[, <max-size>])
      • 定义一条行数规则。
      • <line-count> 可以是精确的正整数,例如 1,也可以是开放区间,例如 3 to infinity
      • <min-size> 为必填项,类型是 <length>
      • <max-size> 为可选项,类型是 <length>。如果省略,则默认等于 <min-size>,表示命中该规则时使用固定字号。

    形式定义

    初始值[]
    适用元素text
    是否支持继承no
    是否支持动画no

    形式语法

    -x-auto-font-size-line-ranges = <line-range-function>#
    
    <line-range-function> = line-range( <line-count> , <length> [, <length>]? )
    <line-count> = <integer> | <integer> to infinity

    与 Web 的区别

    • Lynx 特有的属性。

    注意事项

    • 此属性仅在 -x-auto-font-size 开启时生效。
    • 此属性会覆盖 -x-auto-font-size 中的最小字号和最大字号设置。
    • 当此属性被设置后,-x-auto-font-size-preset-sizes 不生效。

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。