Style overflowYProperty

Style 对象参考手册Style Object

Example

If text overflows the element's content area, provide vertical scrolling:

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

Try it yourself »

Definition and Usage

The overflowY property specifies whether to clip the top/bottom edges of the content - if the content overflows the element's content area.

Tip:Please use theoverflowXproperty to determine the clipping of the left/right edges.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the overflowY property.

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


Syntax

Return the overflowY property:

object.style.overflowY

Set the overflowY property:

object.style.overflowY="visible|hidden|scroll|auto|initial|inherit"

Property Values

Value Description
visible Content is not clipped, and it may be displayed outside the content box.
hidden Content is clipped, and no scrolling mechanism is provided.
scroll Content is clipped, and a scrolling mechanism is provided.
auto If the content overflows the box, a scrolling mechanism should be provided.
initial Sets this property to its default value. Seeinitial。
inherit Inherits this property from its parent element. Seeinherit。

Technical Details

Default value: visible
Return value: A string, representing the element's overflow-y property.
CSS Version CSS3


Related Articles

CSS Reference:overflow-y property


Style 对象参考手册Style Object

Other Extensions