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

Top comments (0)

🌚 Turn on dark mode

πŸ”  Change your default font

πŸ“š Adjust your experience level to see more relevant content

Head to your account's Settings to do all this and more.