How to set div scroll bar properties and styles

Source: Internet
Author: User
div scroll bar is the use of div tags, embedded in the CSS style sheet, when the Div defines the content of the area to a certain extent, in the div tag embedded CSS style sheet, define overflow property values, set the div scrollbar related properties.

Here to describe the P scroll bar properties and style settings, the so-called P-scroll bar, is the use of P tags, embedded in the CSS style sheet, add overflow attribute value, so that when the content of the area specified by P to reach a certain program, the scroll bar comes in handy.

P scroll bar properties and style settings

The so-called P scroll bar, is to use the P tag, embedded in the CSS style sheet, add overflow attribute value, so that when the content of the area specified by P to reach a certain program, the scroll bar comes in handy. Its function is about to save the page space, is called "Shrinking ground".

When the content of the area defined by P reaches a certain extent, the CSS style sheet is embedded in the P tag, the attribute value of overflow is defined, and the properties related to the P scrollbar are set.

Example code:

<styletylestyletyle= "Text/css" >. testdiv{  border-style:solid;  border-width:50px;  Border-color:pink;   Position:absolute;  top:200px;  left:300px;  height:200px;  width:300px;   Overflow-x:scroll;  Overflow-y:hidden;   Scrollbar-face-color:green;  scrollbar-hightlight-color:red;  Scrollbar-3dlight-color:orange;  Scrollbar-darkshadow-color:blue;  Scrollbar-shadow-color:yellow;  Scrollbar-arrow-color:purple;  Scrollbar-track-color:black;  Scrollbar-base-color:pink;   }   </style>

Note:

1.overFlow:

Visible is saved, there is no P scroll bar, depending on the size of the content auto-expanding area, that is, the defined area is invalid.

Scroll always show scroll bars

Hidden no scroll bar, content beyond the area is not visible

Auto determines whether or not to add scroll bars based on content

2.P scroll bar Color properties:

Face-color: Slider Color

Hightlight-color: Highlight Color

3dlight-color: three-dimensional light color

Darkshadow-color: Shadow Color

Shadow-color: Shadow Color

Arrow-color: Arrow Color

Track-color: Slide Color

Base-color:p the main color of the scroll bar, which contains scroll buttons and scroll sliders

3.overflow-xoverflow-y

Visible is saved, there is no P scroll bar, depending on the size of the content auto-expanding area, that is, the defined area is invalid.

Scroll always show scroll bars

Hidden no P scroll bar, content beyond the area is not visible

Auto determines whether or not to add scroll bars based on content

    1. What does the expert P mean?

    2. JavaScript dynamically creates P properties and styles

    3. The difference between a SPAN element and a P element

    4. Page-break-after attribute usage in CSS2.0

    5. Explore the Border:none in CSS, and the difference between border:0;

Summarize:

This article describes the P scroll bar properties and style settings, the so-called P-scroll bar, is the use of P tags, embedded in the CSS style sheet, add overflow attribute value, so that when the content of the area specified by P to reach a certain program, the scroll bar comes in handy.

Related recommendations:

CSS Control scroll bar style parsing


CSS3 Examples of custom scroll bar styles


css example of setting div scroll bar style

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.