Does the browser provide reflection if the position of an element is absolute?

If I have an element with an absolute position, and I change it to the left, and the top position will reflect the parent children? and what about your own children if they are not affected, since they are also absolute positions of the left and top axis?

If I change the width / height of the element, but do not matter in the parent and in it children?

+6
source share
2 answers

An object with an absolute position does not affect the page layout. The page is laid out without taking into account the absolute positional object. Moving an object with absolute positioning does not cause any reflection of other objects.

Moving an object with absolute positioning will cause the child objects to move with it. It will not re-refill them, they just move along with its parent container.

+11
source

For an element with an absolute position, it should not affect the flow of the document, so changing the position should not lead to a re-planning (relaying) of the page tree, but if you check this simple case with Chrome DevTools, we see that it really causes a relay (the whole document ), although in a very short time. Probably, the rendering engine did not consider it as a special case.

+2
source

Source: https://habr.com/ru/post/896817/


All Articles