Set DIV scroll bar

Source: Internet
Author: User

This is a very common task, basically through the CSS to implement the scroll bar.
scroll bar
Sets whether the scroll bar is displayed primarily by setting the following properties in CSS:

The code is as follows:
Overflow:visible|auto|hidden|scroll
Overflow-x: Horizontal scroll bar
OVERFLOW-Y: Vertical scroll bar


The meaning of the parameter:
Visible: Do not cut content or add scroll bars. If this default value is explicitly declared, 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. Cut content and add scroll bars when needed
Hidden: Do not display content beyond the object size
Scroll: Always show scroll bars
Overflow:auto; This means that when your content exceeds the div height the vertical scroll bar appears
So we want to show the vertical scroll bar when we need to, so we can do this:

The code is as follows:
<divstyle= "Overflow:auto;" >...</div>

Set DIV scroll bar

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.