+ 3

Guys please tell me what is the difference between absolute and relative position in css.

how know where i will use which position property.

3rd Dec 2016, 8:09 AM
Ashish Dhiman
Ashish Dhiman - avatar
2 Respostas
+ 6
in position fixed the element is stuck and remain there even if you scroll. in relative position the element is positioned according to flow of others in absolute the element is placed out of flow so you can move it left right top
3rd Dec 2016, 9:58 AM
Sandeep Chatterjee
+ 5
There are quite a few difference between them but one major difference is that for absolute position, if it has no position fixed to it, it uses the body and moves with the page. (Meaning that if you scroll the page, the thing will just follow you, like an annoying advertisement) But this does not apply for relative.
3rd Dec 2016, 8:14 AM
Wen Qin
Wen Qin - avatar