Export (0) Print
Expand All

visibility

Sets whether the content of the object is displayed.

{ visibility: sVisibility }

sVisibility

String that specifies or receives one of the following values:

inherit

Default. Object inherits the visibility of the next parent object.

hidden

Object is hidden.

visible

Object is visible.

The property has a default value of inherit. The cascading style sheet property is not inherited.

Unlike an object with its display property set to none, objects that are hidden using the visibility property still reserve the same physical space in the content layout as they would if they were visible. You can change the visibility through scripting to show and hide overlapping content based on user interaction.

The following example uses the visibility property to determine whether the object is visible. This example uses two calls to an embedded (global) style sheet to hide and then show the image when the user moves the pointer over and then off the text:

<style>
    .vis1 {visibility:visible}
    .vis2 {visibility:hidden}
</style>
</head>
<body>
<img id="oSphere" src="sphere.jpg">
<p onmouseover="oSphere.className='vis2'" 
   onmouseout="oSphere.className='vis1'">
   Move the mouse over this text to make the sphere   
   disappear.</p>

A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DEFAULTS, DFN, DIV, DL, DT, EM, EMBED, FIELDSET, FORM, HN, HR, HTML, I, IFRAME, IMG, INPUT TYPE=BUTTON, INPUT TYPE=CHECKBOX, INPUT TYPE=FILE, INPUT TYPE=IMAGE, INPUT TYPE=PASSWORD, INPUT TYPE=RADIO, INPUT TYPE=RESET, INPUT TYPE=SUBMIT, INPUT TYPE=TEXT, LI, OBJECT, OL, P, S, SELECT, SPAN, SUB, TABLE, TBODY, TD, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP

Community Additions

ADD
Show:
© 2014 Microsoft