Make DIV invisible in CSS and JavaScript

后端 未结 6 1388
执笔经年
执笔经年 2021-02-07 00:49

I have managed to make a DIV tag invisible in JavaScript by setting the display to none and the visibility to hidden. It can be achieved with this class also:

.i         


        
6条回答
  •  温柔的废话
    2021-02-07 01:32

    Layout-wise, display:none takes it completely out of the rendering tree and into this netherworld limbo. It has no well-defined dimensions or position anymore.

    If you need some placeholder for scroll position, I'd suggest using a placeholder element. Some zero-height DIV or maybe even an would work.

提交回复
热议问题