---
title: "Discussion on \"Position: Absolute; Position: Relative;\" | Hashnode"
description: "Discussion on \"Position: Absolute; Position: Relative;\". What is the difference between using position absolute and relative"
url: "https://hashnode.com/posts/position-absolute-position-relative/61f0448787fd2728e7cd3dd0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Position: Absolute; Position: Relative;](https://theaviatorcodes2.hashnode.dev/position-absolute-position-relative?utm_source=hashnode&utm_medium=feed)

What is the difference between using position absolute and relative

Jan 25, 2022 · 3 min read · theaviatorcodes2.hashnode.dev  
Updated Jan 31, 2022  
Read the article

-   [#hashnodecommunity](https://hashnode.com/tag/hashnodecommunity)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#newbie](https://hashnode.com/tag/newbie)
-   [#css](https://hashnode.com/tag/css)
-   [#hashnode](https://hashnode.com/tag/hashnode)

## Written by

[Victor Yakubu](https://hashnode.com/@theAviatorCodes2)

@theAviatorCodes2 · Abuja, Nigeria

  
[View profile](https://hashnode.com/@theAviatorCodes2)

I'm a software developer and I currently live and work in Nigeria. I write articles mainly targeted at Newbies in the tech field.

I also write about what I'm learning and building on this blog—most of them about programming, technology and documentation.

## Responses 1

Markdown supported · ⌘↵ to post

[Joe Attardi](https://hashnode.com/@joeattardi)

[Jan 26, 2022](https://hashnode.com/posts/position-absolute-position-relative/61f0448787fd2728e7cd3dd0/comment/61f0b76687fd2728e7cd47be)

The section on `position: absolute` is not quite accurate - the element is not necessarily positioned relative to its parent container.

An absolutely positioned element is positioned relative to the nearest _ancestor_ (not necessarily direct parent) that has a `position` other than `static`. Sometimes it can get a little tricky.

To make an absolutely positioned element relative to its containing element, you can just set `position: relative` on the parent.

[Victor Yakubu](https://hashnode.com/@theAviatorCodes2)

[Jan 26, 2022](https://hashnode.com/posts/position-absolute-position-relative/61f0448787fd2728e7cd3dd0/comment/61f0b76687fd2728e7cd47be#reply-61f1035487fd2728e7cd50de)

Thank you very much for the feedback back and correction. I really appreciate it. I will edit it.
