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