Latest web development tutorials

HTML DOM Style overflowY property

Style Object Reference Style Objects

Examples

If the text overflows the content area element provides vertical scrolling:

document.getElementById("myDIV").style.overflowY="scroll";

try it"

Definition and Usage

overflowY attribute specifies whether the content of the upper / lower edge of the crop - if the content overflows the element's content area.

Tip: Use overflowX property to determine the left / right edge of the cut.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support overflowY property.

Note: overflowY property does not work in IE8 and earlier versions of.


grammar

Back overflowY properties:

object .style.overflowY

Setting overflowY properties:

object .style.overflowY="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-y attribute of the element.
CSS version CSS3


related articles

CSS Reference: overflow-Y property


Style Object Reference Style Objects