# Relative

Relative positioning moves an element away from its own normal place, and keeps the space it would have used.

Apprentice · CSS · Updated November 15, 2026

By Gregor Dzierzon

## After this lesson you can

- Shift an element from its normal place with relative positioning and top or left, keeping its space in the page

## Key takeaways

- Relative positioning moves an element away from the place it would normally be.
- A top of 30px moves it 30px down from its normal place, and a left of 30px moves it 30px right.
- The space it would have taken is kept, so nothing else moves, and it scrolls with the page.

`relative` position moves an element away from where it would normally be. `top: 30px; left: 30px;` shifts it 30px down and 30px right of its own normal place. The space it would have taken is still kept, so nothing else moves.

```css
.div-2 {
    position: relative;
    left: 30px;
    top: 30px;
}
```

![Div 2 shifted 30px down and 30px right of its normal place, overlapping div 3, which hasn't moved](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/76e3f4332da2412cad75e989347694be.png "Div 2 uses position: relative")

As the page is scrolled, all elements scroll together.

![After scrolling, div 2 has moved up with the other divs, still shifted from its normal place](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/1fba8749ef1c4203826b332ef201d202.png "Div 2 scrolls with all other divs")

## Do it: nudge the Staff pick label

On your reading list, the *Staff pick* label next to *Frankenstein* should look like a sticker that's been stuck on a little low and to the right. The words around it must not move.

Here is the move:

| What | The value |
|---|---|
| Moved from | the label's own normal place |
| Down | `4px` |
| Right | `6px` |
| The words around it | stay where they are |
| The New label next to *Dracula* | stays as it is |

**Your job:** write one rule for the Staff pick label, class `pick`.

- Move it from its own normal place, keeping the space it would have taken, so nothing else moves.
- Move it `4px` down and `6px` right.
- Don't change the New label, class `new`.

Practiced live on the lesson page: write the CSS right there and check it.

## Check yourself

2 questions to try on the lesson page.

## So what

Relative is the gentle nudge: it moves one element a little without disturbing anything around it, and the next lesson uses it to mark a parent for absolute positioning.

## Key terms

- [Relative positioning](https://www.ask-codey.com/glossary/relative-positioning)

## Cheat sheets

- [Static and Relative](https://www.ask-codey.com/cheat-sheets/css-position-static-cheat-sheet)

Source: https://www.ask-codey.com/lessons/css-position-relative
