Skip navigation
Are you using position: absolute; to overlap elements?
0:00 / 0:50

Are you using position: absolute; to overlap elements?

Wes Bos

@wesbos447K followers

Visit on X
3,706 likesDownloadOriginal post

302,363 views

Are you using position: absolute; to overlap elements? It's almost always better to Use CSS Grid instead!

11 Comments

Comments from the original post on X (Twitter)

  • Wes Bos's profile picture

    @wesbos

    Second video! Your questions + tips

    49 likes

  • Bruno Stasse's profile picture

    @brunostasse

    And you can make it more concise with grid-area: 1 / 1;

    47 likes

  • Wes Bos's profile picture

    @wesbos

    👌😮‍💨 even better

    2 likes

  • trash's profile picture

    @trashh_dev

    i’m using absolute like i’m coding in the stone ages

    35 likes

  • Wes Bos's profile picture

    @wesbos

    absolute: chad;

    38 likes

  • James Landrum's profile picture

    @JamesRLandrum

    It’s a hack but a hack that I love. And one that technically the layout engine is purposely written to support.

    15 likes

  • Wes Bos's profile picture

    @wesbos

    hah yeah, I'm not sure I'd even call it a hack - its a feature of CSS grid to have multiple items on grid rows/cols

    16 likes

  • Caleb Porzio's profile picture

    @calebporzio

    My guy, this is fantastic

    6 likes

  • Wes Bos's profile picture

    @wesbos

    thanks my guy!

    2 likes

  • Alex Parra's profile picture

    @alexpds45

    Cool demo! I dreamt of this back in 2017 And in 2020 posted it was possible with grid. There’s likely updates I need to make to that posts.

    5 likes

  • Wes Bos's profile picture

    @wesbos

    Awesome! I also included it in my course back then too. Just re-surfacing as I still don't see it used a ton

    8 likes