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

后端 未结 10 1206
故里飘歌
故里飘歌 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:37

    To hide the element visually, but keep it in the html, you can use:

    [content]

    or

    [content]

    What may go wrong with display:none? It removes the element completely from the html, so some functionalities may be broken if they need to access something in the hidden element.

提交回复
热议问题