跳过导航
Future CSS Tip! 🔮 Anchor Positioning lets you anchor elements to others with CSS alone 👍 It can also…
0:00 / 0:36

Future CSS Tip! 🔮 Anchor Positioning lets you anchor elements to others with CSS alone 👍 It can also…

jhey ʕ•ᴥ•ʔ

@jh3yy15万 位关注者

在 X 上查看
723 个赞下载原帖

160,652 次观看

Future CSS Tip! 🔮 Anchor Positioning lets you anchor elements to others with CSS alone 👍 It can also work out positioning if an element gets clipped by a container, window, etc. Think "Common floating UI uses with no JS" 🤯 .el { bottom: anchor(--link top); } Just CSS 👇

10 条评论

评论来自 X (Twitter) 上的原帖

  • jhey ▲🐻🎈 的头像

    @jh3yy

    If you want to see this demo in action, here's the @CodePen link! 🤙 You'll need to be in Chrome Canary with the "Experimental Web Platform Features" flag enabled ⛳️ This one anchors Popovers using the Popover API 😎

    9 个赞

  • jhey ▲🐻🎈 的头像

    @jh3yy

    And here's an article I put together all about Anchor Positioning that looks into some of the main parts of this CSS API 👀

    5 个赞

  • Andreas Eracleous 的头像

    @AndreasFrontDev

    This is great! tip! thanks you for sharing

    1 个赞

  • jhey ▲🐻🎈 的头像

    @jh3yy

    It'll be pretty cool when/if it lands in other browsers! 💯

    1 个赞

  • blah 的头像

    @jonny555333

    Unrelated question but when is it the right time to implement these new css features? Browser support can widely vary and many systems will still run old browser version so what's the recommended way to go about this?

  • AellL 的头像

    @AellL_Tw

    @SaveToNotion #thread #css

  • Shripal Soni 的头像

    @codewithshripal

    Wow! This will be really very helpful 🤩

  • Marina Luna 的头像

    @moonssoul

    🤯!

  • Erik Rasmussen 👨‍💻🇺🇸🇪🇸 的头像

    @erikras

    Whoa…

  • Joshua Riley 的头像

    @JoshuaRiley01

    A @tailwindcss version of this would be amazing