I am working on angular 8 and using mat-dialog. Right now, the mat-dialog overlay is covering the entire page and mat-dialog is on the center of the page as shown below.

But I want the mat-dialog over a div only and the overlay should also appear on a parent div only i.e. mat-dialog should be relative to a parent div as shown in the image below. How to do this? Also, it is a responsive web-page so, adding the position of mat-dialog and overlay is a lot of work and may not look good in different screens sizes. If it is not possible with angular material then please suggest some other framework (bootstrap, etc.) or other methods.
