Another css margin padding

The relative container simply sets the stacking context fro the absolute element. All nested absolute elements will be placed in respect of this parent. It is basic css and there’s nothing complex to it that you wouldn’t use in any other similar situation.

As usual context is the key and there are often many different ways to do something in CSS but it all depends on the job in hand as to which approach is best.

It would be fine inside a flexbox assuming that the anchor is not a flex item (refer to ‘context is the key’ quote above :)).