Making Elements Invisible


Name:

visibility

Value:

visible | hidden

Initial:

visible

Applies to:

all elements

Inherited:

yes

Percentages:

N/A


With display, you can remove elements from display (display: none), but there is another way to make elements invisible. The visibility property doesn't remove elements, but makes them completely transparent. In other words, if you set visibility to hidden, you see an empty space where the element is supposed to be.

This is most useful if you have multiple alternative style sheets for the same page, or if you have a script that changes the style. You can use it to selectively show the answers to a quiz (for example, while keeping everything else on the page the same).

The value visible makes elements visible, hidden makes them transparent. The property actually has a third value, collapse, which can make table columns disappear, but we won't discuss it here (refer to the CSS2 specification for an explanation).



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net