Question discussion

Which statement correctly distinguishes the CSS declarations display: none and visibility: hidden?

2534Medium DSSSB TGT Computer Science 0 replies 1 views
0

Which statement correctly distinguishes the CSS declarations display: none and visibility: hidden?

  • Adisplay: none removes the element from the layout, while visibility: hidden hides it but keeps the space that it occupies
  • Bdisplay: none keeps the space of the element, while visibility: hidden removes it from the layout
  • CBoth of them remove the element from the layout in the same way
  • DBoth of them delete the element from the DOM
Correct answer: A

Explanation

With display: none the element generates no box and takes no space, whereas visibility: hidden only makes the box invisible and the empty space remains.

Discussion 0

Nobody has replied yet. Start the discussion!