用于隐藏HTML元素的CSS,保持其宽度和高度? [英] CSS for hiding a HTML element, keeping its width and height?
本文介绍了用于隐藏HTML元素的CSS,保持其宽度和高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个CSS代码片段来隐藏HTML < div class =my>
(包含很多内容,包括文本和其他div)但仍然为它留有空间。有没有比 div.my {opacity:0;}
?更快或更快的解决方案 div>
visibility:hidden
这会隐藏元素,但保留其在布局中的位置。
I need a CSS snippet for hiding a HTML <div class="my">
(with quite a 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.
这篇关于用于隐藏HTML元素的CSS,保持其宽度和高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文