The problem of position location of a div element in a single file component

when a div in a single file component sets opsition to absolute, but the root element under the template tag does not set any position, is the location relative to the root element of the component or the body of the entire page? (the css attribute located by position is written in the style tag with scoped attribute.) I also hope that all of you will give us some advice

.
May.26,2021

div elements whose opsition is absolute are positioned relative to elements whose parent element is not position:static (default). If the parent element does not exist, then relative to body.


position:absulute, it keeps looking for position:relative elements at the upper level, just like bubbles, until it is found, or relative to the html tag if none of them are found.

Menu