CSS overflow (visible auto hidden scroll) tutorial

Source: Internet
Author: User

DIV css Overflow (visible auto hidden Scroll) syntax structure and CSS overflow tutorial

Overflow can be implemented to hide out of object content, but also to show and hide the scroll bar, then we learn to learn CSS overflow style.
First, overflow syntax value-TOP

overflow:visible | Auto | Hidden | Scroll

Of course overflow can set the scrollbar style individually in X (overflow-x) and Y (overflow-y) directions with the same value as the app and the overflow syntax usage structure.

Extended reading:
1. Hide content Beyond Object method
2, CSS Hidden
3. CSS Hidden Content method
Second, overflow parameter value interpretation-TOP

Visible: Do not cut content or add scroll bars. Body Music Relaxation Chair If you explicitly declare this default value, the object is clipped to the size of the window or frame that contains the object. and the Clip property setting is invalidated
Auto: This is the default value for the body object and textarea. If you want to cut the content and add scrollbars when needed, the div defaults to this value, but it needs to be set to
Hidden: Do not display content beyond the object size
Scroll: Always show scroll bars
Iii. Overflow Special explanation-TOP

Retrieves or sets how content is managed when the object's content exceeds its specified height and width.
Setting the TextArea object to a hidden value hides its scroll bar.
For table, if the Table-layout property is set to fixed, the TD object supports a overflow property with a default value of hidden. If set to Hidden,scroll or auto, the body sense music relaxation chair then the content that exceeds the TD size will be cut. If set to visible, causes additional text to overflow to the right or left (depending on the direction property setting) of the cell.
This property is available on the Mac platform from IE5 onwards.
Iv. Key Learning Overflow-top

Overflow:visible This style allows the scrollbar to be hidden, but it can be pulled down by the mouse.
Overflow:hidden hidden objects beyond the height of the set width (CSS hidden overflow tutorial: http://www.divcss5.com/wenji/w415.shtml)
Overflow:scroll This style causes the scroll bar to be displayed regardless of whether the content is out of height or not.
V. Overflow:hidden and Overflow:scroll Practice-TOP

We set by the same width height, the body sense music relaxation chair a hidden beyond the width of the height of the content, one for the display scroll bar, for the case demonstration, we have a case 2 objects plus CSS border border.

1. CSS Code

. divcss5-hidden,.divcss5-scroll{width:300px; height:100px;line-height:25px; border:1px Solid #333}
. Divcss5-hidden{overflow:hidden; height:50px}
. Divcss5-scroll{overflow:scroll; margin-top:10px}

2. HTML code

<div class= "Divcss5-hidden" >
hides out of bounds but does not show scrolling, DIVCSS5 overflow:hidden test demonstration
case, set high and wide after object, Body Music Relaxation Chair content more than object
</div>
<div class= "Divcss5-scroll" >

</div>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.