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

# font-size

APISummary
## Introduction

`font-size` CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative `<length>` units, such as em, ex, and so forth.

## Examples

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

**Entry:** `src/font-size`
**Bundle:** `dist/font-size.lynx.bundle`

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

const FontSize = () => {
  const fontStyle = {
    fontSize: "30px",
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view className="fixed_area">
        <text>hello lynx, default font size</text>
        <text style={fontStyle}>hello lynx, font size 30px</text>
      </view>
    </scroll-view>
  );
};

root.render(<FontSize />);

```

v0.11.0



## Syntax

```css
/* <length> */
font-size: 12px;
font-size: 0.8em;

/* <percentage> */
font-size: 80%;
```

### Values

- `<length>` 

  Positive `<length>` value. For most font-relative units (such as em and ex), the font size is relative to the parent element's font size.

- `<percentage>` 

  A positive `<percentage>` value, relative to the parent element's font size.

## Formal definition

| Initial value | 14px |
| Applies to | text |
| Inherited | yes |
| Animatable | no |


## Formal syntax

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

## Differences from the Web

- Only support `<length>` and `<percentage>`

- Default font-size is **14px** not **medium**.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.font-size`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| font-size | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`font-size`**

**Specifications:**

