Pesky HTML layout: how to hide an element while saving the layout?

I want to hide the form input field. But calling setVisible ('inputID', false) causes my liquid layout to crash. I do not want it.

Is there any easy solution? I was thinking of trying to make the foreground background color, background color and border color white. But it gets too complicated.

+3
source share
4 answers

There are two ways to hide elements with css:

  • Sets the attribute displaytonone

  • Setting attribute visibilitytohidden

The first option removes the element from the stream, and the second option hides the element, but still allows it to take up space in the stream.

, .

:

document.getElementById('inputID').style.visiblity = 'hidden';
+7

"" "", , .

+3

, , :

  • , JavaScript, , , div , , , , .

  • div HTML / CSS. JavaScript, .

0

.

.

.

position:relative
left:-2000px

It should remove the element from the screen, but leave the “hole” where it would be.

-1
source

Source: https://habr.com/ru/post/1705285/


All Articles