Skip to main
Video
CSS snippet showing display revert

What does revert do in CSS?

And how is it different from unset or initial?

I’ve often used initial and unset in my CSS – global keywords that can be applied to any property. The difference is small, but important: unset allows inheritance, while initial does not. But then Firefox implemented revert and I was confused – how is this one different from the others?

Revert takes user and user-agent styles into consideration

It turns out revert is the one I wanted all along. It rolls back styles to the expected browser default for each element, rather than using the specification default for each property.

Recent Videos

  1. Title card from the podcast with headshots of Brad and Mia
    Video post type

    Pottery, Theater, CSS Collaboration, and the Ethics of AI

    Brad chats with Miriam Suzanne about pottery, theater, CSS, and why we shouldn’t just accept AI as the way. Miriam describes their through-line as collaborative creativity across pottery, theater, client work, and CSS standards, arguing process shapes results and that CSS is inherently collaborative with users, browsers, and devices.

    see all Video posts
  2. Video post type

    How to Use CSS Anchor Positioning TODAY

    CSS anchor positioning simplifies popovers and dropdowns, and also unlocks new creative possibilities. James joined Jason to teach and explore anchor positioning in live code.

    see all Video posts
  3. Video post type

    Smashing Hour with Miriam Suzanne

    I joined Geoff Graham for a Smashing live stream to talk about CSS, web standards, music, and more!

    see all Video posts