CSS for hiding a HTML element, keeping its width and height?

前端 未结 2 1491
醉梦人生
醉梦人生 2021-01-17 09:24

I need a CSS snippet for hiding a HTML

(with quite a lot of contents, including text and other divs), but still reserving space for it.
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-17 09:58

    use document.getElementById("my").style.display = "none"; do not user visibility it only hide element but in display it remove the space acquired by element.

提交回复
热议问题