> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# box-sizing

APISummary
## Introduction

The `box-sizing` property defines whether fixed sizes (such as `<length>`s and `<percentage>`s) are assigned to the content box or to the border box. It affects the interpretation of all sizing properties, including [`width`](/next/api/css/properties/width.md), [`height`](/next/api/css/properties/height.md), [`min-width`](/next/api/css/properties/min-width.md), [`min-height`](/next/api/css/properties/min-height.md), [`max-width`](/next/api/css/properties/max-width.md), [`max-height`](/next/api/css/properties/max-height.md).

## Examples

**This is an example below: css-api**

**Entry:** `src/box-sizing`
**Bundle:** `dist/box-sizing.lynx.bundle`

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

const BoxSizing = () => {
  const scrollViewStyle = {
    height: "100%",
  };

  const fixedAreaStyle = {
    width: "100%",
    height: "100%",
    flexDirection: "column" as const,
    background: "white",
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      <view className="fixed_area" style={fixedAreaStyle}>
        <view className="div1">
          <text>FL</text>
        </view>
        <view className="div2">
          <text>FR</text>
        </view>

        <view className="div3">
          <text>BL</text>
        </view>
        <view className="div4">
          <text>BR</text>
        </view>
      </view>
    </scroll-view>
  );
};

root.render(<BoxSizing />);

```

v0.11.0



## Syntax

```css
box-sizing: border-box;
box-sizing: content-box;
```

### Values

- `border-box`

  **Default value**. The [`width`](/next/api/css/properties/width.md) and [`height`](/next/api/css/properties/height.md) properties include the content, padding, and border, but do not include the margin.

  Size calculation formula:

  width = border + padding + content

  height = border + padding + content

- `content-box`

  The [`width`](/next/api/css/properties/width.md) and [`height`](/next/api/css/properties/height.md) properties include the content, but does not include the padding, border, or margin.

  Size calculation formula:

  width = content

  height = content

## Formal definition

| Initial value | `border-box` |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |


## Formal syntax

```
box-sizing = border-box | content-box
```

## Differences from the Web

- Default value is `border-box` in Lynx, while `content-box` in web.
- It will not affect the interpretation of [`flex-basis`](/next/api/css/properties/flex-basis.md), while Web will.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.box-sizing`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/6-box-sizing.json) · [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| box-sizing | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`box-sizing`**

**Specifications:**

