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/perspective.md.
Lynx
  • 简体中文
  • perspective

    介绍

    CSS 属性 perspective 指定了观察者与 z=0 平面的距离,使具有三维位置变换的元件产生透视效果。z>0 的三维元件比正常大,而 z<0 时则比正常小,大小程度由该属性的值决定。

    使用示例

    语法

    /* Keyword value */
    perspective: auto;
    
    /* <length> values */
    perspective: 20px;
    perspective: 3.5em;

    取值

    • auto 没有应用 perspective 样式时的默认值。

    • [<length>] 指定观察者距离 z=0 平面的距离,为元件及其内容应用透视变换。当值为 0 或负值时,无透视变换。

    形式定义

    初始值空值
    适用元素所有元件
    是否支持继承no
    是否支持动画no

    形式语法

    perspective = auto | <length [0,∞]>

    与 Web 的区别

    • 不同于 Web,Lynx 中 Perspective 属性对当前节点生效,而 Web 中 Perspective 属性对孩子节点生效

    兼容性

    LCD tables only load in the browser

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