Difference between “visibility:collapse” and “display:none”

前端 未结 5 1633
醉酒成梦
醉酒成梦 2020-11-30 01:43

What is the difference between visibility:collapse and display:none?

5条回答
  •  有刺的猬
    2020-11-30 02:06

    visibility:collapse should only be used on tables. On other elements it will act as a visibility:hidden.

    visibility:hidden hide the element but still take the space of the element whereas display:none won't even keep the space.


    Resources :

    • w3schools.com - visibility
    • w3schools.com - display

    On the same topic :

    • What is the difference between visibility:hidden and display:none
    • CSS Properties: Display vs. Visibility
    • CSS display:none and visibility:hidden
    • Does opacity:0 have exactly the same effect as visibility:hidden

提交回复
热议问题