Relative vs Absolute

i am beginner in this course i tried to understand my self about relative and absolute but i did not understand it properly can any one explain what is that ? , use of that ? difference between them ?

Hi @Learner3, welcome to the forum.

I think MDN has a great explanation about the position property.

It should have all the information you need (and more :wink: )

Hi @Learner3
The way I’d explain the difference between relative and absolute is … if you think of the web page like lego blocks you lay out on the floor, one after the other.
Relative, the block would be placed in the next available space.
Absolute, the block is taken out of the normal “flow” of the page, thus can be positioned anywhere on the screen.

Absolute isn’t affected by things like floats.
Floats allow other blocks to “flow” around them like water around a rock.

1 Like