English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
overflow-The CSS property specifies how content overflowing the top and bottom edges of the element's content area is clipped, displayed as a scrollbar, or shown as overflow content.
下表为此属性的用法说明和版本历史记录,以及该属性在javascript脚本中的使用语法。
The following table provides usage instructions and version history for this property, as well as the usage syntax of this property in JavaScript scripts. | visible |
---|---|
Default value: | Applies to:-Block, inline |
block and flex containers | Inheritance: |
No | Can be animated:No. Please see. |
Animation properties | CSS3version |
New feature of | object.style.overflowY="scroll" |
The syntax of this property is as follows:
overflow-y: visible | hidden | scroll | auto | initial | inherit
The following examples demonstrate how to use overflow-y property.
div { width: 400px; height: 300px; overflow-x: scroll; }Test to see‹/›
The following table describes the values of this property.
Value | Description |
---|---|
visible | The content is not clipped; it is rendered outside the element's box, so it may overlap with other content. This is the default value. |
hidden | The content within the overflow element's box will be clipped, and the remaining content will be invisible. |
scroll | The overflow content is clipped as if hidden, but provides a scrolling mechanism to access the overflowed content. |
auto | If the content overflows the element's box, it will provide a scrollbar to view the remaining content. |
initial | Set this property to its default value. |
inherit | If specified, the associated elements will use their parent element's overflow-y property values. |
overflow-y property browser compatibility, the numbers in the following table indicate the minimum version number of the browser that supports this property; all mainstream browsers support this property.
|
Warning: Internet Explorer 7and earlier versions do not support this overflow-y property. IE8supports this property, but requires Microsoft-specific-ms-prefix (e.g.-ms-overflow-y). In IE9and higher versions are supported.
Please refer to the following tutorials:CSS Overflow.
Related properties:overflow,overflow-x,clip,word-wrap.