CSS Visibility


The visibility property specifies whether or not an element is visible.

Syntax

visibility:visible|hidden|collapse|initial|inherit;
Value Description
visible Default value. The element is visible
hidden The element is invisible (but still takes up space)
collapse This is for use only with dynamic table columns and row effects.
inherit Inherits this property from its parent element.

Example

 <!DOCTYPE html>
    <html>
     <head>
        <style type="text/css">
        .hidden{
        visibility:hidden;
        }
        </style>
        </head>
        <body>
        <p>This paragraph should be visible in normal way.</p>
        <p class="hidden">This paragraph should not be visible.</p>
     </body>
    </html>
Output

This paragraph should be visible in normal way.

This paragraph should not be visible.


Share this article on