The Different (and Modern) Ways to Toggle Content

Let’s spend some time looking at disclosures, the Dialog API, the Popover API, and more. We’ll look at the right time to use each one depending on your needs. Modal or non-modal? JavaScript or pure HTML/CSS? Not sure? Don’t worry, we’ll go into all that.


The Different (and Modern) Ways to Toggle Content originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

https://css-tricks.com/the-different-and-modern-ways-to-toggle-content/

Creato 3mo | 8 nov 2024, 14:50:18


Accedi per aggiungere un commento

Altri post in questo gruppo

Positioning Text Around Elements With CSS Offset

When it comes to positioning elements on a page, including text, there are many ways to go about it in CSS — the literal position property with corresponding inset-* prope

24 gen 2025, 16:50:19 | CSS tricks
Some Things You Might Not Know About Custom Counter Styles

I was reading through Juan’s recent Almanac entry for the @counter-style at-rule and I’ll be darned if he didn’t uncover and unpack some extremely interesting things

23 gen 2025, 17:40:29 | CSS tricks
Creating a “Starred” Feed

Chris wrote about “Likes” pages a long while back. The idea is rather simple: “Like” an item in your RSS reader and dis

21 gen 2025, 14:40:17 | CSS tricks
Fancy Menu Navigation Using Anchor Positioning

Anchor positioning can be great for little interactive effects — as Temani Afif shows off with this clever idea for a menu hover.


17 gen 2025, 15:40:06 | CSS tricks
Web-Slinger.css: Across the Swiper-Verse

Lee Meyer with a super clever idea using scroll-driven animations as an interaction to "like" or "dislike" something.


15 gen 2025, 17:20:12 | CSS tricks
A Few Ways That Cloudways Makes Running This Site a Little Easier

(This is a sponsored post.)

It’s probably no surprise to you that CSS-Tricks is (proudly) hosted on

14 gen 2025, 15:50:06 | CSS tricks
How to Wait for the sibling-count() and sibling-index() Functions

Today, I want to look into one of those cases of impatient and how the community has waited for that feature, to be specific, two upcoming functions: sibling-count() and sibling-index().


13 gen 2025, 16:40:05 | CSS tricks