HTML DOM Style overflowX property
Examples
If the text overflows the content area element provides a horizontal scrolling:
document.getElementById("myDIV").style.overflowX="scroll";
try it"
Definition and Usage
OverflowX attribute specifies whether the content of the left / right edge of the crop - if the content overflows the element's content area.
Tip: Use overflowY property to determine the upper / lower edge of the cut.
Browser Support
All major browsers support overflowX property.
Note: overflowX property does not work in IE8 and earlier versions of.
grammar
Back overflowX properties:
object .style.overflowX
Setting overflowX properties:
object .style.overflowX="visible|hidden|scroll|auto|initial|inherit"
Property Value
值 | 描述 |
---|---|
visible | 不裁剪内容,可能会显示在内容框之外。 |
hidden | 裁剪内容,且不提供滚动机制。 |
scroll | 裁剪内容,且提供滚动机制。 |
auto | 如果溢出框,则应该提供滚动机制。 |
initial | 设置该属性为它的默认值。请参阅 initial 。 |
inherit | 从父元素继承该属性。请参阅 inherit 。 |
technical details
Defaults: | visible |
---|---|
return value: | String representing the overflow-x property element. |
CSS version | CSS3 |
related articles
CSS Reference: overflow-X property