CSS - div之overflow:scroll

[color=green][b]Definition[/b][/color]

The overflow property specifies what happens if content overflows an element's box.


[color=green][b]Usage[/b][/color]

[color=brown]Default value:[/color] visible
[color=brown]Inherited:[/color] no
[color=brown]Version:[/color] CSS2
[color=brown]JavaScript syntax:[/color] object.style.overflow="scroll"


[color=green][b]Property Values[/b][/color]

[b]Value[/b] [b]Description[/b]
[color=blue]visible[/color] The overflow is not clipped.
It renders outside the element's box.
This is [color=green]default [/color]

[color=blue]hidden[/color] The overflow is clipped,
and the rest of the content will be invisible

[color=blue]scroll[/color] The overflow is clipped,
but a scroll-bar is added to see the rest of the content

[color=blue]auto[/color] If overflow is clipped,
a scroll-bar should be added to see the rest of the content

[color=blue]inherit[/color] Specifies that the value of the overflow property
should be inherited from the parent element.


[color=brown]如果 只有文本超出div宽度时,才显示scroll,
则设为 : overflow : auto[/color]


[color=green][b]当然,还可以指定:[/b][/color]

overflow-x :auto;
overflow-y :auto;


[url]http://www.w3schools.com/cssref/pr_pos_overflow.asp[/url]


-

你可能感兴趣的:(css)