CSS 锚点定位实现磁吸 Bento 卡片悬停效果

jh3yy · x · 2026-10-02

前端开发者 jh3yy 分享了一段用 CSS anchor positioning 实现的「磁吸 bento 悬停」效果代码:鼠标悬停某张卡片时将其设为锚点(anchor-name: --a),指示层通过 position-anchor 与 anchor(inside) 自动贴合并随 inset 过渡滑动,无需 JavaScript。

原文链接 →

「编程与Agent」频道最新

更多「编程与Agent」频道 AI 资讯 →