Is there a way to place a close button on the top right corner of a dialog box, partially inside and outside the dialog like shown in this image:
I attempted using absolute positioning to achieve this, but that solution is not ideal.
I want to position the button relative to the dialog itself. I also tried using float:right
and negative margin-top
, however, part of the button remains hidden even when setting z-index
to over 1000.
<button mat-mini-fab style="cursor:pointer;position:absolute;top:420px;left:900px">
<i class="material-icons" (click)="close()">close</i>
</button>
https://i.sstatic.net/vH6cy.png (Source: codota.com).