div之overflow-scroll

Definition

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


Usage

Default value: visible
Inherited: no
Version: CSS2
JavaScript syntax: object.style.overflow="scroll"



Property Values

Value                 Description
visible        The overflow is not clipped.
                It renders outside the element's box.
                This is default

hidden        The overflow is clipped,
                and the rest of the content will be invisible

scroll        The overflow is clipped,
                but a scroll-bar is added to see the rest of the content

auto       If overflow is clipped,
                a scroll-bar should be added to see the rest of the content

inherit      Specifies that the value of the overflow property
                should be inherited from the parent element.





如果 只有文本超出div宽度时,才显示scroll,
     则设为 :  overflow : auto





当然,还可以指定:

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









http://www.w3schools.com/cssref/pr_pos_overflow.asp















-

你可能感兴趣的:(auto,overflow,div,scroll)