CSS display Property

来源:互联网 发布:mac手写输入法快捷键 编辑:程序博客网 时间:2024/05/01 15:39

转载:http://www.w3schools.com/cssref/pr_class_display.asp


Example

Display <p> elements as inline elements:

p.inline
{
display:inline;
}

Try it yourself »

Definition and Usage

The display property specifies the type of box used for an HTML element.

Default value:inlineInherited:noVersion:CSS1JavaScript syntax:object.style.display="block"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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

ValueDescriptionPlay itinlineDefault. Displays an element as an inline element (like <span>)Play it »blockDisplays an element as a block element (like <p>)Play it »inline-blockDisplays 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-tableThe element is displayed as an inline-level table list-itemLet the element behave like a <li> elementPlay it »run-inDisplays an element as either block or inline, depending on context tableLet the element behave like a <table> element table-captionLet the element behave like a <caption> element table-column-groupLet the element behave like a <colgroup> element table-header-groupLet the element behave like a <thead> element table-footer-groupLet the element behave like a <tfoot> element table-row-groupLet the element behave like a <tbody> element table-cellLet the element behave like a <td> element table-columnLet the element behave like a <col> element table-rowLet the element behave like a <tr> element noneThe element will not be displayed at all (has no effect on layout)Play it »inheritThe value of the display property will be inherited from the parent element 


原创粉丝点击