---
title: "Explain the differences between display: none, visibility: hidden, and opacity: 0?"  
description: "Explain the differences between display: none, visibility: hidden, and opacity: 0?"  
author: "Ravi Vishwakarma"  
published: 2024-06-05  
updated: 2024-06-05  
canonical: https://www.mindstick.com/forum/160671/explain-the-differences-between-display-none-visibility-hidden-and-opacity-0  
category: "css-css3"  
tags: ["css-css3", "css"]  
reading_time: 2 minutes  

---

# Explain the differences between display: none, visibility: hidden, and opacity: 0?

[Explain the differences](https://www.mindstick.com/forum/158322/explain-the-differences-between-prototypal-and-classical-inheritance-in-javascript) between display: none, [visibility](https://www.mindstick.com/blog/301300/how-to-improve-your-visibility-in-zero-click-search-results): [hidden](https://www.mindstick.com/forum/2303/skip-validating-field-from-hidden-div), and opacity: 0?

## Replies

### Reply by Ravi Vishwakarma

Certainly! These are three different CSS properties used to hide elements on a webpage, but they achieve this in different ways:

`display: none;`:

- This property removes the element from the document flow entirely. It's as if the element doesn't exist in the HTML structure.
- The space it occupies is also removed, so other elements will behave as if the hidden element isn't there.
- This property completely hides the element, including its space on the page.
- It's often used when you don't want the element to take up any space or affect the layout.

`visibility: hidden;`:

- This property hides the element while still occupying the space it would normally take up in the document flow.
- It's like making the element invisible, but it still affects the layout of the page.
- Other elements will behave as if the hidden element is still there, leaving a gap where the element would be.
- It's useful when you want to hide an element but maintain its position in the layout.

`opacity: 0;`:

- This property makes the element transparent, but it still occupies space and affects the layout.
- Unlike `visibility: hidden;`, the element's space on the page is retained.
- Other elements will not reflow to fill the space occupied by the transparent element.
- It's often used when you want to hide an element gradually or when you still want to interact with the element (e.g., clickable links) but don't want it to be visible.

In summary, `display: none;` removes the element from the document flow entirely, `visibility: hidden;` hides the element while preserving its space in the layout, and `opacity: 0;` makes the element transparent while still occupying space on the page. Each property has its use case depending on how you want the hidden element to interact with other elements on the page.


---

Original Source: https://www.mindstick.com/forum/160671/explain-the-differences-between-display-none-visibility-hidden-and-opacity-0

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
