正在加载视频...
视频加载失败
Are you using position: absolute; to overlap elements? It's almost always better to Use CSS Grid instead!
302,188 次观看 • 2 年前 •via X (Twitter)
11 条评论

Wes Bos2 年前
Second video! Your questions + tips

Bruno Stasse2 年前
And you can make it more concise with grid-area: 1 / 1;

Wes Bos2 年前
👌😮💨 even better

trash2 年前
i’m using absolute like i’m coding in the stone ages

Wes Bos2 年前
absolute: chad;

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

Wes Bos2 年前
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

Caleb Porzio2 年前
My guy, this is fantastic

Wes Bos2 年前
thanks my guy!

Alex Parra2 年前
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.

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

