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

    介绍

    指定一个元件内容与上边界的距离,该属性不能为负值。

    使用示例

    语法

    /* <length> values */
    padding-top: 0.5em;
    padding-top: 0;
    
    /* <percentage> value */
    padding-top: 10%;

    取值

    0px

    默认值

    <length>

    <length> 定义为一个绝对值。不能为负值。

    <percentage>

    相对于包含块的行内尺寸(宽度)的百分比。必须是非负值。

    形式定义

    初始值0
    适用元素所有元件
    是否支持继承
    是否支持动画yes
    百分比refer to the width of the containing block

    形式语法

    padding-top =
      <length-percentage [0,∞]>
    
    <length-percentage> =
      <length>      |
      <percentage>

    兼容性

    LCD tables only load in the browser

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