XML technologies / CSS / Advanced websites with CSS / CSS property reference / overflow-x, overflow-y

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The nonstandard properties overflow-x and overflow-y work like overflow, but define height and width separately. overflow-x describes browser behaviour for horizontally overflowing content, and overflow-y for vertically overflowing content.

Inherited: no

See also: overflow

Values

The same constants as for overflow.

Default value: visible

Compatibility

CSS version: not part of the CSS specification

Work only in Internet Explorer for Windows from version 5.

Corresponding functionality is planned for CSS3, although the final property and value names will probably differ. Current information is available on the CSS Working Group website.

Example

The following rule gives the element with the ID hauptmenue a fixed height and width. A scrollbar appears if content overflows vertically. Horizontally overflowing content is clipped at the boundaries:

#hauptmenue{
 width: 150px;
 height: 400px;
 overflow-x: hidden;
 overflow-y: auto;
}

  

 

 

 

back to top