正在加载视频...
视频加载失败
CSS Tip! 💪 You can create these tab controls with CSS :has() + radio buttons ✨ .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } .tabs::after { translate: calc(var(--active, 0) * 100%) 0; width: calc(100% / var(--count)); } Two CSS :has() tricks here combined with a rendering trick... show more
9 条评论

jhey ▲🐻🎈2 年前
Here's that @CodePen link! 🚀 Remember, CSS :has() is available in all the major browsers now 👀 It's a great time to start getting familiar with it ⭐️

toprakcavusdag.js2 年前
That's super. Thank you for sharing us

jhey ▲🐻🎈2 年前
More than welcome! 🙏

Kay 🇮🇪2 年前
Tried to find it for tailwind but no luck!?

Carlito2 年前
Sorcery!

JEM2 年前
still wrapping my head around :has() 😵💫

jhey ▲🐻🎈2 年前
Wrote this one in 2022 that might help 🤙 Got some much cooler demos to show off for it now though 😁

randomhuman2 年前
Beautiful 👌

Souvik Bhattacharjee2 年前
Nice 🔥
