I would like to position an element absolute relative to a parent outside of an Angular component. But this does not work. I have the following structure:
<div id="div1" style="position:relative; padding-left: 20px">
<some-angular-component>
<div id="div2" style="position: absolute">
...
</div>
</some-angular-component>
</div>
I would like to have div2
to be positioned relative to div1
(and therefore not be affected by the padding-left) but this does not seem to work. It seems to be positioned relative to the angular component HTML tag.
Here is a Stackblitz link below showing this.
https://stackblitz.com/edit/angular-ivy-j3estd?file=src/app/hello.component.ts
Does anyone know how I can position 'div2' relative to 'div1', with the Angular component tag in between them?
Cheers :)