Positioning: Relative/Absolute Badge

easy
By FrontendAtlas Editorial · Updated Nov 25, 2026
This pattern is used in notifications, status indicators, and card metadata, so the badge should remain anchored even as content size changes. Edge cases include long titles and responsive cards; test overlap and ensure accessible contrast. Trade-off: absolute positioning is simple but can break if parent sizing changes.

Solution idea

Absolute positioning within a relatively positioned parent keeps the badge anchored to the card corner while removing it from normal flow.

Public interview reports

These public, self-reported interview accounts informed this practice version. The exercise is modelled on reported rounds, not copied from them, and the reports are not verified official questions or endorsements.

Reported in a public Tesla interview account. Tesla frontend interview questions

Reported in a public Shopee interview account. Shopee frontend interview questions