DEV Community

Cover image for Stacking elements using css
sonu sharma
sonu sharma

Posted on

1

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.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay