Scroll bar style settings for HTML

Source: Internet
Author: User
If you need to set a scroll bar to the Div, then you may need to set the scrollbar style, landscape or portrait, need to use overflow-y and overflow-x to set, today to tell you about these two properties.

Set the scrollbar for the Div, and set its horizontal and vertical scroll bar styles. The desired CSS style is overflow-y and overflow-x to set the right and bottom scrollbar effects for the Div box object. You can also use CSS styles to set scroll bar shadowing for an IFRAME in an HTML frame.

Overflow-y:scroll; Always show portrait scroll bar

Overflow-y:visible: Do not cut content or add vertical scroll bars

Div Set scroll bar instance

By setting the div width, div height, div border style for the first Div object, and adding the presentation text to the Div box, the second box sets the same CSS style, the box text content is the same, and the horizontal and vertical scroll bars are set to observe the effect.

The first box CSS is named "Divcs5-a" and the second div box style selector is named "Div-b".

1, the specific complete HTML source code is as follows:

<! DOCTYPE html> 

To see the effect, we set the same CSS style and the same text content for the two div boxes. The ". Div-b" setting has X and Y (the horizontal and vertical scroll bar styles.) )

Description: The first box ". Div-a" content overflow div box, the second box set the scroll bar style, so there is no overflow, vertical right (Y) has a pull-up scroll bar style, the horizontal bottom (X) scroll bar effect, but not left and right pull, This is because the text content does not open the div width, if it is larger than the div set width of the picture so that the horizontal bottom (X) will appear scroll bar effect.

Related Article

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.