# position

> Sets `position: relative`.

```ts
import { relative } from "@sdxc/u/layout";
```

Sets `position: relative`.

## Quick reference

Every documented call, beside the CSS it emits.

| Call | CSS |
| --- | --- |
| `u.relative()` | `css({ position: "relative" })` |

## Examples

### Basic example

Use `relative()` to position an element in the normal flow, so its absolutely positioned children are offset from it:

```tsx
<div mix={[relative(), is(72), bs(36), ...]}>
	<p>Relative parent</p>
	<div mix={[absolute(), insBs(3), insIe(3), ...]}>absolute()</div>
</div>
```

### Offsetting in the flow

Add offsets like `insBs(4)` and `insIs(6)` to shift a relative element from its place, while the space it came from stays reserved:

```tsx
<div mix={[...]}>
	<div mix={[relative(), insBs(4), insIs(6), ...]}>relative()</div>
</div>
```

## Applying on a state

Wrap the call in a state utility to scope it to one selector.

```ts
u.hover(u.relative())
```

## Responsive design

Wrap the call in a container query to scope it to one width.

```ts
u.at("md", u.relative())
```

## Signature

```ts
u.relative()
```
