Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
@cheatsheet1999

Description

@cheatsheet1999

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions