DEV Community

Cover image for Stacking elements using css
sonu sharma
sonu sharma

Posted on

Stacking elements using css

Using position property of css to place elements one over the other.

What are the alternatives ?

Top comments (1)

Collapse
 
alohci profile image
Nicholas Stimpson • Edited
  1. Overflow.

  2. Negative margins.

  3. Grid cell reuse

There's also paint-time shifts like position:relative and transform:translate but since these leave a "ghost" in the layout of where they were shifted from, they're typically not what you want for this use-case.