DEV Community

Dezina
Dezina

Posted on

Difference between display:none and visiblity: hidden

visibility:hidden hides the element, but it still takes up space in the layout.

display:none removes the element from the document. It does not take up any space.

https://www.w3schools.com/css/tryit.asp?filename=trycss_display

Top comments (0)

👋 Kindness is contagious

Dive into this insightful article, celebrated by the caring DEV Community. Programmers from all walks of life are invited to share and expand our collective wisdom.

A simple thank-you can make someone’s day—drop your kudos in the comments!

On DEV, spreading knowledge paves the way and strengthens our community ties. If this piece helped you, a brief note of appreciation to the author truly counts.

Let’s Go!