<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk" -->

---
title: Easily transition to and from display: none | daily.dev
description: Animating elements transitioning to and from display:none is now straightforward with a few modern CSS features. The technique uses opacity and translate for...
canonical: https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Easily transition to and from display: none | daily.dev
og:description: Animating elements transitioning to and from display:none is now straightforward with a few modern CSS features. The technique uses opacity and translate for...
og:url: https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk
og:image: https://api.daily.dev/og/posts/EWDr6klRK.png
og:image:alt: Easily transition to and from display: none
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Easily transition to and from display: none

**[Kevin Powell](https://daily.dev/sources/kevinpowell)** · 2 min read · 11 upvotes · 1 comments

## Summary

Animating elements transitioning to and from display:none is now straightforward with a few modern CSS features. The technique uses opacity and translate for visual effects, the transition property extended to include display and overlay, the new transition-behavior: allow-discrete to enable transitioning normally non-animatable properties, and the @starting-style at-rule to define the initial state when an element first becomes visible. A popover example demonstrates fade-in/slide-down on open and fade-out/slide-down on close. Key gotcha: display changes (like display:grid) should only be set in the open state, while layout properties like grid-template-columns belong on the closed state.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=o24HzAnBRyw>

## Community discussion

Top comments from developers on daily.dev.

**@sahilatahar** · 2 upvotes

> I call you the God of CSS.

---

Tags: [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Easily transition to and from display: none","url":"https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk"},"datePublished":"2026-07-16T13:17:05.882Z","dateModified":"2026-07-16T13:17:30.025Z","description":"Animating elements transitioning to and from display:none is now straightforward with a few modern CSS features. The technique uses opacity and translate for...","image":"https://i.ytimg.com/vi/o24HzAnBRyw/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/o24HzAnBRyw/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Kevin Powell","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Kevin Powell","logo":"https://media.daily.dev/image/upload/s--XK5Rf0kM--/f_auto/v1717745137/logos/kevinpowell","url":"https://daily.dev/sources/kevinpowell"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":11},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"css","timeRequired":"PT2M","video":{"@type":"VideoObject","name":"Easily transition to and from display: none","description":"Animating elements transitioning to and from display:none is now straightforward with a few modern CSS features. The technique uses opacity and translate for...","thumbnailUrl":"https://i.ytimg.com/vi/o24HzAnBRyw/sddefault.jpg","uploadDate":"2026-07-16T13:17:05.882Z","duration":"PT2M","url":"https://api.daily.dev/r/EWDr6klRK","embedUrl":"https://www.youtube.com/embed/o24HzAnBRyw"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Kevin Powell","item":"https://daily.dev/sources/kevinpowell"},{"@type":"ListItem","position":3,"name":"Easily transition to and from display: none"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/easily-transition-to-and-from-display-none-ewdr6klrk","comment":[{"@type":"Comment","text":"I call you the God of CSS.","datePublished":"2026-07-17T06:16:19.491Z","url":"https://daily.dev/posts/EWDr6klRK#c-BncBXLane","author":{"@type":"Person","name":"Sahil Atahar","url":"https://daily.dev/sahilatahar","image":"https://media.daily.dev/image/upload/s--jYTP98TM--/f_auto/v1768622996/avatars/avatar_3E5CUHMGZwkEqSfvFYXsF?_a=BAMAMiiu0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
```

