正在加载视频...

视频加载失败

Use CSS Grid to stack items, and visibility: hidden to hide/show spinner. This approach allows the largest item to size the button, and keeps the button text accessible

176,975 次观看 • 1 年前 •via X (Twitter)

11 条评论

Wes Bos 的头像
Wes Bos1 年前

If you like this one, here is another demo of CSS Grid stacking →

Marko 的头像
Marko1 年前

grid-area: 1/-1; You don't need to name area to use grid-area. I really like your approach.

Wes Bos 的头像
Wes Bos1 年前

ah good point - you can just use the implicit grid columns

trash 的头像
trash1 年前

is that a… middle finger?

Wes Bos 的头像
Wes Bos1 年前

as the Good Lord intended

mshub 的头像
mshub1 年前

took different parts from ppl in this thread this is nice

Wes Bos 的头像
Wes Bos1 年前

Big fan of this! Nice work

Anthony 的头像
Anthony1 年前

We all know the real reason you made this video is so you can show off that badass mouse pointer 😂

Wes Bos 的头像
Wes Bos1 年前

🖕😁🖕

Panta 的头像
Panta1 年前

I love this! I should use grid to overlay elements more often. The only problem with visibility: hidden is that you can't transition between the two states using fade in/out.

Wes Bos 的头像
Wes Bos1 年前

you can also add opacity to this to get in/out transitions If you want to do more allow-discrete and content-visibility will do this as well

相关视频