DEV Community

Md Shah Jalal
Md Shah Jalal

Posted on • Updated on

display 'none' vs visibility 'hidden'

What are the difference between display ‘none’ and visibility ‘hidden’?
Using the attribute “visibility: hidden” for an HTML element will be hidden from the webpage but still, take up space. Using the attribute “display: none” for an HTML element will be hidden, and also it won’t take up any space on the webpage.

Remember it:

display: none;
Enter fullscreen mode Exit fullscreen mode

and

visibility: hidden;
Enter fullscreen mode Exit fullscreen mode

Oldest comments (0)