How do you create a hidden div that doesn't create a line break or horizontal space?

后端 未结 10 1207
故里飘歌
故里飘歌 2020-11-29 15:18

I want to have a hidden checkbox that doesn\'t take up any space on the screen.

If I have this:


      
10条回答
  •  执笔经年
    2020-11-29 15:38

    Since you should focus on usability and generalities in CSS, rather than use an id to point to a specific layout element (which results in huge or multiple css files) you should probably instead use a true class in your linked .css file:

    .hidden {
    visibility: hidden;
    display: none;
    }
    

    or for the minimalist:

    .hidden {
    display: none;
    }
    

    Now you can simply apply it via:

    
    

提交回复
热议问题