Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Sets or retrieves whether the object is rendered.
What's New for Microsoft® Internet Explorer 6This property supports the list-item value.
Syntax
{ display : sDisplay } |
object . style.display [ = sDisplay ] |
Possible Values
sDisplay | String that specifies or receives one of the following values.
|
The property is read/write for all objects except the following, for which it is read-only: currentStyle . The property has a default value of inline for all objects with the following exceptions:
ADDRESS | block |
BLOCKQUOTE | block |
BODY | block |
CENTER | block |
COL | block |
COLGROUP | block |
DD | block |
DIR | block |
DIV | block |
DL | block |
DT | block |
FIELDSET | block |
FORM | block |
FRAME | none |
hn | block |
HR | block |
IFRAME | block |
LEGEND | block |
LI | list-item |
LISTING | block |
MARQUEE | block |
MENU | block |
OL | block |
P | block |
PLAINTEXT | block |
PRE | block |
TABLE | block |
TBODY | none |
TD | block |
TFOOT | none |
TH | block |
THEAD | none |
TR | block |
UL | block |
XMP | block |
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties .
Remarks
In Internet Explorer 4.0, the block , inline , and list-item values are not supported explicitly, but do render the element.
The block and inline values are supported explicitly as of Internet Explorer 5.
In Internet Explorer 5.5 and earlier, the default value of this property for li elements is block .
The inline-block value is supported as of Internet Explorer 5.5. You can use this value to give an object a layout without specifying the object's height or width.
All visible HTML objects are block or inline. For example, a div object is a block element, and a span object is an inline element. Block elements typically start a new line and can contain other block elements and inline elements. Inline elements do not typically start a new line and can contain other inline elements or data. Changing the values for the display property affects the layout of the surrounding content by:
In contrast to the visibility property, display = none reserves no space for the object on the screen.
The table-header-group and table-footer-group values can be used to specify that the contents of the tHead and tFoot objects are displayed on every page for a table that spans multiple pages.
Examples
This example shows the effect of changing the values for the display property between inline , block , and none .
<SPAN ID=oSpan> This is a SPAN </SPAN> in a sentence. <P>This example uses function calls to hide and show table rows and cells.
<SCRIPT>
Standards Information
This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) .
Applies To
|
A , ACRONYM , ADDRESS , APPLET , B , BDO , BIG , BLOCKQUOTE , BODY , BR , BUTTON , CAPTION , CENTER , CITE , CODE , COL , COLGROUP , currentStyle , CUSTOM , DD , defaults , DEL , DFN , DIR , DIV , DL , DT , EM , EMBED , FIELDSET , FONT , FORM , FRAME , 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 , INS , KBD , LABEL , LEGEND , LI , LISTING , MARQUEE , MENU , NOBR , OBJECT , OL , P , PLAINTEXT , PRE , Q , RT , RUBY , S , SAMP , SELECT , SMALL , SPAN , STRIKE , STRONG , style , SUB , SUP , TABLE , TBODY , TD , TEXTAREA , TFOOT , TH , THEAD , TR , TT , U , UL , VAR , XMP |
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |