开发者

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

开发者 https://www.devze.com 2022-12-20 16:30 出处:网络
I need a CSS snippet for hiding a HTML <div class=\"my\"> (with quite a开发者_如何学C lot of contents, including text and other divs), but still reserving space for it. Is there something better

I need a CSS snippet for hiding a HTML <div class="my"> (with quite a开发者_如何学C lot of contents, including text and other divs), but still reserving space for it. Is there something better or faster than div.my{opacity:0;}?


visibility: hidden

This will hide the element from the page but retain its place in the layout.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号