转载:http://www.w3schools.com/cssref/pr_class_display.asp
Definition and Usage
The display property specifies the type of box used for an HTML element.
Default value: | inline |
---|---|
Inherited: | no |
Version: | CSS1 |
JavaScript syntax: | object.style.display="block" |
Browser Support
The display property is supported in all major browsers.
Note: The values "inline-table", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-row", "table-row-group", and "inherit" are not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports the values.
Property Values
Value | Description | Play it |
---|---|---|
inline | Default. Displays an element as an inline element (like <span>) | Play it » |
block | Displays an element as a block element (like <p>) | Play it » |
inline-block | Displays an element as an inline-level block container. The inside of this block is formatted as block-level box, and the element itself is formatted as an inline-level box | |
inline-table | The element is displayed as an inline-level table | |
list-item | Let the element behave like a <li> element | Play it » |
run-in | Displays an element as either block or inline, depending on context | |
table | Let the element behave like a <table> element | |
table-caption | Let the element behave like a <caption> element | |
table-column-group | Let the element behave like a <colgroup> element | |
table-header-group | Let the element behave like a <thead> element | |
table-footer-group | Let the element behave like a <tfoot> element | |
table-row-group | Let the element behave like a <tbody> element | |
table-cell | Let the element behave like a <td> element | |
table-column | Let the element behave like a <col> element | |
table-row | Let the element behave like a <tr> element | |
none | The element will not be displayed at all (has no effect on layout) | Play it » |
inherit | The value of the display property will be inherited from the parent element |