Position property allows to move element from its native place. position: static Default value with normal CSS flow position: relative Moves element from its native place with left/right/top/bottom properties Can not use both left & right ; top & bottom Negative coordinates are allowed position: absolute Absolutely positioned element is removed from the flow and its place is taken by other elements top/bottom/left/right count from nearest positioned parent (not static) If no positioned parent found, then element is positioned from the document Width fits the content Element becomes display: block , which overlays other blocks left/right , top/bottom can be set together and element will be stretched position: fixed Same as position: absolute , but relative to window When window is scrolled, element stays in place Modal window can be achieved with
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 999;
position: sticky The top, right, bottom, and left properties determine the final location of positioned elements.