I attempted to demonstrate how a failing test case could be shown for a flawed full-screen modal. Surprisingly, it is possible to confine a position: fixed;
element by utilizing CSS transforms on the container. For instance, applying transform: translate(200px);
to a container will disrupt its full-screen characteristics, causing it to behave like a regular div.
Upon further investigation, I discovered that not only transform, but also filter
and perspective
can have similar effects.
In response to the initial query, achieving relative positioning within the container akin to the relative-absolute combination is not feasible. However, you can confine the element inside a relative container without impacting the placement or sizing properties of top
, right
, bottom
, left
.