- 1

The difference between absolute, relative, and fixed

2nd Dec 2016, 12:58 PM
Piday 3.14159 265358
Piday 3.14159 265358 - avatar
2 Answers
+ 5
in absolute the position of image is put out of flow from from other elements so you can move it left right bottom in relative it is with the flow of other elements in fixed it is stuck at one place even if you scroll
2nd Dec 2016, 1:06 PM
Sandeep Chatterjee
+ 4
Absolute will give an absolute position in the page and Releative will give a position relative to the absolute position ....so if I had a rectangle and gave it an "Absolute" position of (top:50px) on a screen of (100px) for example ...then this would position the rectangle in the center area of the screen ......then you could have a circle inside the rectangle and give it a position "Relative" with (top:20px) then this top20px command will position the circle relative from the top of the rectangle in the center and not the top of the screen FIXED is what it says fixed ...good to use if u want menu bars and so on to follow you as you scroll down or up a page. ... Hope this helps
2nd Dec 2016, 1:15 PM
Ed Hanlon
Ed Hanlon - avatar