How can the parent div be highly adaptive and use position positioning to avoid collapse?

as shown in figure

the parent div is position:relative,4, and the child div is absolute,. When the parent height is auto, how to use the child div height to prop up the parent div?

.

Mar.13,2021

absolute are separated from the document stream, and


can only be achieved by JS


you try to give the parent div setting: overflow:hidden;
verification, reply me if you can.


then you can use js to get this height in a div, in the parent div, and then set a box-sizing:border-box;


out of the document stream to the parent div. It doesn't work if the parent writes auto .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36aa5-2c038.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36aa5-2c038.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?