css中display的属性...
时间:2010-08-09 来源:yangautumn43
display
« CSS « CSS Reference
Summary
The display CSS property specifies the type of rendering box used for an element. In HTML, default display property values are taken from behaviors described in the HTML specifications or from the browser/user default stylesheet. The default value in XML is inline.
In addition to the many different display box types, the value none allows the display of an element to be turned off; all child elements also have their display turned off. The document is rendered as though the element did not exist in the document tree.
- Initial value : inline
- Applies to: all elements
- Inherited : no
- Media: visual
- Computed value : as specified, except for root element, floated elements, and absolutely positioned elements
Syntax
display: <display-value> | inherit
Values
<display-value> can be any of the following values:
noneTurns off the display of an element (it has no effect on layout); all child elements also have their display turned off. The document is rendered as though the element did not exist.To render an element box's dimensions, yet have its contents be invisible, see the visibility property.inlineThe element generates one or more inline element boxes.blockThe element generates a block element box.inline-block Requires Gecko 1.9Introduced in CSS 2.1. The element generates a block element box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would).list-itemThe element generates a block box for the content and a separate list-item inline box.compact(Unsupported, dropped from the CSS 2.1 standard)run-inUnimplemented in Gecko/Firefox, bug 2056.
- If the run-in box contains a block box, same as block.
- If a block box follows the run-in box, the run-in box becomes the first inline box of the block box.
- If a inline box follows, the run-in box becomes a block box.
相关阅读 更多 +