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,
State of CSS Frameworks,
October 2022
    Video post type

    State of CSS Frameworks

    How can we write our styles in style?

    A panel conversation with library and methodology authors and CSS aficionados about recent features added to CSS, developments in how to write more effective, maintainable CSS in small teams and at scale, and what libraries and trends to investigate.

    see all Video posts
  2. Video post type

    Making Sense of CSS Layers and Scope

    CSS is evolving rapidly and new features come online all the time. Join Morten & Miriam to talk about what CSS layers and scope are all about and how they will change how we work with and think about the cascade in the future.

    see all Video posts
  3. Weekly fireside chat:
What's the job of a design engineer?
Featuring Miriam Suzanne
    Video post type

    What’s the job of a “design engineer”?

    A fireside chat

    There are often tall walls between designers and developers, sometimes with only one significant handoff moment during a sprint. We discuss the role of the ‘design engineer’ and what it means for workflows, collab with their product team, and the end-user experience.

    see all Video posts