zoukankan      html  css  js  c++  java
  • How to Hide a control but keep its space occupied?

    Usually, to hide a control or a block in HTML, we can use the following JavaScript to set the style of the control or the block,

    document.getElementById(“”).style.display=”none”;

    or apply the following  css,  

    .some-css-name

    {

       display:none

    But it will remove the space occupied by the control as well. If we want to keep the space, but only want to hide the control, we can use the following way,

    document.getElementById(“”).style.visibility=”hidden”;

    or

    .some-css-name

    {

       visibility:hidden;

    }

    BTW, the reverse function of the above is as below,

    document.getElementById("").style.display="inline"

    document.getElementById("").style.visibility="visible";

  • 相关阅读:
    自介
    打招呼
    试验四
    作业:实验二
    个人简介
    实验4
    构建之法—心得体会
    作业:实验二
    个人简介
    软件测试第四次博客作业2
  • 原文地址:https://www.cnblogs.com/fangwenyu/p/1608562.html
Copyright © 2011-2022 走看看