CSS settings scroll bar color and style and how to remove and hide scrollbars

Source: Internet
Author: User

The code is as follows:
div {
Scrollbar-face-color: #fcfcfc;
Scrollbar-highlight-color: #6c6c90;
Scrollbar-shadow-color: #fcfcfc;
Scrollbar-3dlight-color: #fcfcfc;
Scrollbar-arrow-color: #240024;
Scrollbar-track-color: #fcfcfc;
Scrollbar-darkshadow-color: #48486c;
Scrollbar-base-color: #fcfcfc
}


The scroll bar style mainly involves the following CSS properties:
Overflow property: Retrieves or sets how content is displayed when the object's content exceeds its specified height and width
Overflow:auto; The content is automatically added to the scroll bar when needed
Overflow:scroll; Always show scroll bars
Overflow-x: Hidden; Prohibit horizontal scroll bars
OVERFLOW-Y: scroll; Always show portrait scroll bar
width:568px; width:98%; Set the width of the area [pixels/percent, etc.]
height:120px; Set the height of the area [pixels/percent, etc.]

The code is as follows:
<STYLE>
BODY {
Scrollbar-face-color: #f892cc;
Scrollbar-highlight-color: #f256c6;
Scrollbar-shadow-color: #fd76c2;
Scrollbar-3dlight-color: #fd76c2;
Scrollbar-arrow-color: #fd76c2;
Scrollbar-track-color: #fd76c2;
Scrollbar-darkshadow-color: #f629b9;
Scrollbar-base-color: #e9cfe0
}
</STYLE>


Scrollbar-face-color: The color of the bulge of the scroll bar
Scrollbar-highlight-color: The color of the blank part of the scroll bar
Scrollbar-shadow-color: Color of the solid scrollbar shadow
Scrollbar-3dlight-color: The color of the scroll bar's bright edges
Scrollbar-arrow-color: The color of the triangular arrows on the top and bottom buttons
Scrollbar-track-color: The background color of the scroll bar
Scrollbar-darkshadow-color: Color of the scroll bar strong shadow
Scrollbar-base-color: basic color of scroll bars

Remove scroll bars from Web pages
Remove horizontal scroll bar: <body style= ' Overflow:scroll;overflow-x:hidden ' >
Remove vertical scroll bar: <body style= ' Overflow:scroll;overflow-y:hidden ' >
All two removed: <body scroll= "No" >
Box Plus in the scroll bar after Name= "" Add scrolling= "No"
1,overflow Settings when content overflows
Overflow settings for horizontal and vertical content overflow
Overflow-x settings when the content overflows horizontally
Overflow-y settings for vertical content overflow
The values for the above three properties are visible, scroll, hidden, auto
Visible default value. When you use this value, regardless of the set width and height
The value of which the content, whether or not out of range, is forced to be displayed.
The hidden effect is the opposite of visible. Any inside that exceeds "width" and "height"
will not be visible.
Scroll the scroll bar is displayed regardless of whether the content is beyond the range.
Auto displays scroll bars when content is out of range, otherwise it is not displayed.

Application:
No horizontal scroll bar:
<div style= "Overflow-x:hidden" >test</div>
No vertical scroll bar
<div style= "Overflow-y:hidden" >test</div>
No scroll bar
<div style= "Overflow-x:hidden;overflow-y:hidden" or style= "Overflow:hidden" >test</div>
Automatically show scroll bars
<divstyle= "Height:100px;width:100px;overflow:auto;" >test</div>
2. Define the color of the scroll bar yourself
We generally default scroll bar style as shown in the left, the right is magnified 1600 times times the appearance, we can see the scroll bar has several interpellated combinations, I gave them 7 numbers,
Comment on the following CSS code, note that the CSS comment code is placed in two slashes within the two asterisks, such as:

The code is as follows:
Body {
Scrollbar-arrow-color: #f4ae21;
Scrollbar-face-color: #333;
Scrollbar-3dlight-color: #666;
Scrollbar-highlight-color: #666;
Scrollbar-shadow-color: #999;
Scrollbar-darkshadow-color: #666;
Scrollbar-track-color: #666;
}

CSS settings scroll bar color and style and how to remove and hide scrollbars

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.