Is it possible to have a div with absolute position adjust its width based on its content rather than its parent's width? For example,
<div style="position:absolute">
<div style="position:absolute">
<div style="position:absolute">Div in Div</div>
</div>
</div>
When this structure is used, word wrap occurs as shown in this example.
It appears that the inner div's width is dependent on its parent's width, even though its position is set to absolute. If a width is specified for the parent, there will be no word wrap as seen in this example.
However, I am unable to predetermine the parent's width -- ultimately, the width should depend on its children. Additionally, absolute positioning must be used. Is there a way to achieve this using pure CSS?
The purpose behind this experimentation is not for design purposes, but rather to explore if absolute positioning can provide a solution to complex layout challenges. Unfortunately, this issue may hinder the idea of solely relying on absolute positioning for versatile and intricate layouts.