setting visibility vs. hide/show

后端 未结 5 579
余生分开走
余生分开走 2021-02-07 01:02

What is the difference between element.css(\'visibility\', \'visible\') and element.show(). Also, what is the difference between element.css(\'vi

5条回答
  •  囚心锁ツ
    2021-02-07 01:12

    Taken from w3schools.com:

    visibility:hidden hides an element, but it will still take up the same space as before. The element will be hidden, but still affect the layout.

    display:none hides an element, and it will not take up any space. The element will be hidden, and the page will be displayed as the element is not there:

提交回复
热议问题