XML technologies / CSS / Advanced websites with CSS / CSS property reference / visibility
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property visibility describes whether an element is visible on a page. A hidden element is not displayed but still occupies its space in the page layout. To remove it from the layout too, set its property display to none.
Inherited: yes
See also: display
Values
The property visibility accepts the following constants:
collapse: When applied in a table to a row (tr), row group (thead,tbody,tfoot), column (col) or column group (colgroup), it hides them and shrinks the table accordingly. For other elements it acts likehidden.hidden: The element is invisible but retains its place in the layout.visible: The element is displayed visibly.
Default value: visible
Compatibility
CSS version: 2
Works in all current browsers, but the constant collapse is not supported by any current browser.
Netscape 4 supports visibility only for elements whose position is declared with absolute or relative.
Example
The following rule hides elements of the class aktiv. DHTML can make them visible again in response to user actions, producing an attractive interactive effect.
.aktiv {
visibility: hidden;
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg