> 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.

# padding-right

APISummary
## 介绍

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

## 使用示例

**下面是一个示例: css-api**

**Entry:** `src/padding-right`
**Bundle:** `dist/padding-right.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

import imageUrl from "../../resource/lynx.png";

const PaddingRight = () => {
  const containerStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
    background: "white",
  };

  const contentStyle = {
    paddingLeft: "10px",
    paddingRight: "30px",
  };

  return (
    <view className="con" style={contentStyle}>
      <text className="intro2">2</text>
    </view>
  );
};

root.render(<PaddingRight />);

```

v0.11.0



## 语法

```css
/* <length> values */
padding-right: 0.5em;
padding-right: 0;

/* <percentage> value */
padding-right: 10%;
```

### 取值

#### `<length>`

[`<length>`](/next/zh/api/css/data-type/length.md) 定义为一个绝对值。不能为负值。默认值为 `0px`。

#### `<percentage>`

相对于[包含块](https://developer.mozilla.org/zh-CN/docs/Web/CSS/Containing_block)的行内尺寸（宽度）的百分比。必须是非负值。

## 形式定义

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


## 形式语法

```
padding-right =
  <length-percentage [0,∞]>

<length-percentage> =
  <length>      |
  <percentage>
```

## 兼容性

**Compatibility Table**

**Query:** `css.properties.padding-right`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/34-padding-right.json) · [MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/padding-right)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| padding-right | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`padding-right`**

**Specifications:**

