I am facing an issue with positioning an element absolute relative to a parent outside of an Angular component. Despite using the proper structure, it does not seem to work as expected.
<div id="div1" style="position:relative; padding-left: 20px">
<some-angular-component>
<div id="div2" style="position: absolute">
...
</div>
</some-angular-component>
</div>
My goal is for div2
to be positioned relative to div1
, disregarding the padding-left property and not being affected by the angular component tag in between them.
For further clarification, you can view a demonstration on Stackblitz via the following link:
https://stackblitz.com/edit/angular-ivy-j3estd?file=src/app/hello.component.ts
If anyone has insights on how I can achieve the desired positioning of 'div2' relative to 'div1', your help would be greatly appreciated!
Thank you in advance :)