CSS display Property

转载: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:inline
Inherited:no
Version:CSS1
JavaScript 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 it
inlineDefault. 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 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值