Answers for "css difference between display and visibility"

CSS
4

hidden vs visible

display:none 
/*means that the tag in question will 
not appear on the page at all 
(although you can still interact with it through the dom). 
There will be no space allocated for it between the other tags.*/

visibility:hidden 
/*means that unlike display:none, 
the tag is not visible, but space is allocated for it on the page. The tag is rendered, 
it just isn't seen on the page.*/
Posted by: Guest on November-18-2019
3

css difference between display and visibility

.div-1{
  display: none;
  /* 
  .div-1 Will not reserve a place on the page
  the element will not allocate a space in the page and will not be visible
  */
}
.div-2{
  visibility: visible;
  /* 
  .div-2 Will reserve a place on the page
  the element allocate a space in the page, but its not visible
  */
}
Posted by: Guest on June-14-2021

Code answers related to "css difference between display and visibility"

Browse Popular Code Answers by Language