Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the difference between display:none and visibility:hidden style? #37

Open
cheatsheet1999 opened this issue Sep 16, 2021 · 0 comments

Comments

@cheatsheet1999
Copy link
Owner

They all make elements invisible.

But

  • visibility: hidden hides the element, but it still takes up space in the layout. display: none removes the element completely from the document. It does not take up any space, even though the HTML for it is still in the source code.
  • display: none cannot be inherited.
  • display: none will adjust the spaces, thus automatically aligns the text following it to cover the space, but in case of visibility: hidden space remains intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant