Amazing tip D'Amato! I still use position: absolute; inset: 0
which forces you to change the parent's position
and muck around z-index
which always felt hacky.
Getting back to the inset fill technique. Instead of using
position
, I recommend trying to usedisplay: grid;
instead:
.parent {
display: grid; /** or inline-grid */
}
.child {
grid-area: 1 / 1 / -1 / -1;
}