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

# border-top

APISummary
## Introduction

The border-top shorthand CSS property sets all the properties of an element's right border.

## Examples

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

**Entry:** `src/border-top`
**Bundle:** `dist/border-top.lynx.bundle`

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

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

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

  const styles = [
    ["thick double red", "thin dotted blue"],
    ["10px dashed orange", "medium solid #0000ff"],
    ["5px groove rgba(0,255,0,0.6)", "10rpx ridge hsl(89,43%,51%)"],
    ["thick outset hsla(89,43%,51%,0.3)", "16px inset #ab0"],
  ];

  return (
    <scroll-view className="root" scroll-orientation="vertical" style={scrollViewStyle}>
      <view className="fixed_area" style={fixedAreaStyle}>
        {styles.map((row, rowIndex) => (
          <view key={`normal-${rowIndex}`}>
            <view className="row">
              {row.map((borderStyle, colIndex) => (
                <view
                  key={`normal-${rowIndex}-${colIndex}`}
                  className="box"
                  style={{ borderTop: borderStyle }}
                >
                  <text className="text">{borderStyle}</text>
                </view>
              ))}
            </view>
          </view>
        ))}

        {styles.map((row, rowIndex) => (
          <view key={`radius-${rowIndex}`}>
            <view className="row">
              {row.map((borderStyle, colIndex) => (
                <view
                  key={`radius-${rowIndex}-${colIndex}`}
                  className={`box radiusStyle${colIndex}`}
                  style={{ borderTop: borderStyle }}
                >
                  <text className="text">{borderStyle}</text>
                </view>
              ))}
            </view>
          </view>
        ))}
      </view>
    </scroll-view>
  );
};

root.render(<BorderTop />);

```

v0.11.0



## Syntax

```css
.border {
  border-top: 1px;
}
```

It is actually the same as this one:

```css
.border {
  border-top: 1px solid black;
}
```

### Values

This property is a shorthand for the following CSS properties:

- [`border-top-width`](/next/api/css/properties/border-top-width.md)
  width of the border

- [`border-top-style`](/next/api/css/properties/border-top-style.md)
  style of the border

- [`border-top-color`](/next/api/css/properties/border-top-color.md)
  color of the border

As with all shorthand properties, border-top always sets the values of all the properties that it can set,
even if they are not specified. It sets those that are not specified to their default values. Consider the following code:

## Formal definition

| Initial value | 0 |
| Applies to | all elements |
| Inherited | no |
| Animatable | no |


## Formal Syntax

```
<line-width> || <line-style> || <color>
where
<line-width> = <length> | thin | medium | thick
<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset
```

## Differences from the Web

- [mdn:border-top](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top)

Global values are not supported. (inherit, initial, revert, unset, etc)

Default style value is `solid`.

## Compatibility

**Compatibility Table**

**Query:** `css.properties.border-top`

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

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| border-top | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`border-top`**

**Specifications:**

