+ 2
What is absolute and relative ?
4 Respostas
+ 12
An element with position: relative;is positioned relative to its normal position.
Setting 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.
An element with position: absolute;is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed).
However; if an absolute positioned element has no positioned ancestors, it uses the document body, and moves along with page scrolling.
+ 1
thanks Remmae
0
In addition to previous answer, absolute positioned elements doesn't stretch their ancestors. They are out of the normal flow.
- 3
.idkdhdldmd