Hide div but keep the empty space

后端 未结 5 1733
庸人自扰
庸人自扰 2021-02-01 00:17

I have the following div element:

5条回答
  •  佛祖请我去吃肉
    2021-02-01 00:43

    Try:

    $(".description").css("visibility", "hidden")
    

    hide() is the equivalent to: $(".description").css("display", "none");

    Which does not reserve the space the element was taking.

    Hidden makes the element invisible, but stills reserves the space.

提交回复
热议问题