What’s the difference between a relative fixed absolute and statically positioned element?
position is a CSS property that can have one of the values absolute, fixed, static or relative. It tends to be likewise set to acquire and can be set to the recently embraced property sticky.Three of these values (absolute, fixed, and relative) is joined with the utilization of the left, right, top and bottom properties to set the position coordinates of the element. You may use one or two of them.
HTML elements are positioned static by default. The top,right,bottom,left and z-indexproperties do not apply.
An element with position: relative; is positioned an element based on its current position without changing layout.
The top, right, bottom, and left properties of a relatively-positioned element will cause it to be adjusted away from its normal position. Other content will not be adjusted to fit into any gap left by the element.
Position an element based on its closest positioned ancestor position.