Making the class invisible

I want a div with class "a" to be invisible. I have already tried providing the string display: none; in the CSS file, but what it does is hide it, but it doesn’t catch the place and therefore all my other blocks do not remain in place.

Is there a way to do this using CSS?

+6
source share
3 answers

add .a{visibility: hidden} to your CSS. More on this here:

http://reference.sitepoint.com/css/visibility

+11
source

visibility:hidden should hide the element, keeping it in space so as not to move other elements around.

+1
source

You can use the visibility css property. From the link to the site -

This property indicates whether the element is visible - that is, regardless of the field (s) that the element is generated is rendered.

Please note that even if the field in the normal stream is hidden, it still affects the location of other elements, in contrast to the behavior that occurs when we suppress the generation of boxes at all, setting to show no. Boxes-descendants of the hidden frame will be visible if their visibility is set to visible, while the descendants of an element for which the display is set to none will never create custom fields.

More information can be found here .

+1
source

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


All Articles