+ 9
difference between “display: none” and “visibility: hidden”?
5 ответов
+ 15
• display: none - hides an element, so it does not take up any space. The element will be hidden, and the page will be displayed as if the element is not there.
• visibility: hidden - hides an element, but it will still take up the same space as before. The element will be hidden, but it will still affect the layout.
+ 5
https://code.sololearn.com/WAFkqeajs9bT/?ref=app
👆 There's an element with display:none between box 1 and box 2 and an invisible element between box 2 and box 3
An element with display:none isn't displayed at all. It takes up no space.
Visibility:hidden means that the element is there (it takes up space), but it's invisible
+ 1
For a div the former suppresses and the latter eliminates expression of the div 🤔
+ 1
The visibility if it is hidden there will be spaces still to be left on the page but if it is display none the spaces vanishes .....
0
Display: none; hace que el elemento seleccionado no se despliegue en la pagina. Visibility: hidden; hace que el elemento seleccionado se vuelva por así decirlo "invisible" pero sigue ocupando el mismo espacio 👍💻🙋😀