/

HTML / CSS / JavaScript Tutorial

CSS Property: visibility

[this page | pdf | back links]

The CSS (CSS2) visibility property indicates whether an element is visible or not. Note: Invisible (hidden) elements still take up some space on a page; if you want to avoid this then set the display property to none.

 

Valid property values (other than inherit and initial) are:

 

Value

Description

collapse

Only applies to table elements. Row or column is removed, but table layout is otherwise left unaltered. For non-table elements is equivalent to "hidden"

hidden

Element is hidden (but still takes up space)

visible

(default value). Element is visible

 

Default Value:

visible

JavaScript syntax:

e.g. object.style.visibility="hidden"

Inherited:

No

Animatable:

Yes

 


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile