Element visibility

Expression Studio 4.0

The visibility of a positioned element determines whether the user can see the element. Visibility is useful for temporarily hiding an element, which you might want to do when, for example, a script needs time to calculate the element position or display simple transition effects.

Setting visibility

You can set the visibility by using the visibility property. The following example uses the visibility property to make the DIV element invisible:

<p>A paragraph above the div element</p> 
<div id="Mydiv" style="position: absolute; top: 50px; 
    left: 50px; height: 100px; width: 100px; 
    visibility: hidden;"></div>
<p>A paragraph below the div element</p>

Visibility and document flow

An element that is not visible continues to affect the space in the document layout that the element would occupy even though that space is empty. This is unlike the display property, which does not affect the space in a document layout.

See also

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.