CSS Visibility – How to use visibility property to make elements visible or hidden

CSS Visibility

The visibility property is used to display or hide specified HTML elements. The visibility property value as hidden makes specified element invisible. An element made hidden with visibility: hidden will occupy element’s space.

The different between these two properties to make elements hidden is that elements hidden by display: none property will not occupy any space or web page will look like there is no element.

Whereas element made hidden with visibility: hidden will occupy element’s space.

Example of using Visibility property to make elements hidden

The example below shows how to hide Div and heading 2 elements with visibility: hidden property value. Heading1 and paragraph are visible so you can notice spaces.

Experience this example online



 

Also see CSS display


Was this article helpful?

Related Articles

Leave A Comment?