CSS tutorial: scrollbar attributes and Style Classification

Source: Internet
Author: User

1. Set overflow content overflow (set whether the set object displays a scroll bar)
Settings for overflow-x horizontal content overflow
Settings for overflow-y vertical content overflow
The values of the preceding three attributes are visible (default), scroll, hidden, and auto.

2. scrollbar-3d-light-color three-dimensional scroll bar bright side color (set the color of the scroll bar)
Scrollbar-arrow-color the color of the upper and lower arrow of the buttons
Scrollbar-base-color Basic color of the scroll bar
Scrollbar-dark-shadow-color the color of the strong shadow of the three-dimensional scroll bar
Scrollbar-face-color of the protruding part of the stereo scroll bar
Scrollbar-highlight-color the color of the blank area of the scroll bar
Scrollbar-shadow-color the color of the scroll bar shadow 86oo tutorial

We use several examples to explain the above style attributes:
1. Make the browser window never show a scroll bar
No horizontal scroll bar
<Body style = "overflow-x: hidden">
No vertical scroll bar
<Body style = "overflow-y: hidden">
No scroll bar
<Body style = "overflow-x: hidden; overflow-y: hidden"> or <body
Style = "overflow: hidden"> http://www.o.com

2. Set the scroll bar of the multi-line text box
No horizontal scroll bar
<Textarea style = "overflow-x: hidden"> </textarea> 86oo tutorial
No vertical scroll bar
<Textarea style = "overflow-y: hidden"> </textarea> welcome to 86oo.com.

No scroll bar
<Textarea style = "overflow-x: hidden; overflow-y: hidden"> </textarea>
Or <textarea style = "overflow: hidden"> </textarea>

3. Set the color of the window scroll bar

Set the color of the window scroll bar to red <body style = "scrollbar-base-color: red">
Scrollbar-base-color sets the basic color. Generally, you only need to set this attribute to change the color of the scroll bar.
Add a special effect:
<Body style = "scrollbar-arrow-color: yellow; scrollbar-base-color: lightsalmon">

4. Define a class in the style sheet file and call the style sheet.

<Style>
. Coolscrollbar {scrollbar-arrow-color: yellow; scrollbar-base-color: lightsalmon ;}
</Style>
Call this method as follows:
<Textarea class = "coolscrollbar"> </textarea>

Scrollbar-Face-Color specifies the surface Color of the scroll bar;
Scrollbar-Highlight-Color specifies the Color of the top and left slopes of the scroll bar;
Scrollbar-Shadow-Color specifies the Color of the lower and right slopes of the scroll bar;
Scrollbar-3Dlight-Color for the scroll bar top and left edge color settings;
Scrollbar-Arrow-Color indicates the Color of arrows at both ends of the scroll bar.
Scrollbar-Track-Color is used to set the Color of the scroll bar background;
Scrollbar-Darkshadow sets the color of the bottom and right edge of the scroll bar.

Example:

Copy to ClipboardReference content: [www.bkjia.com] body {
Background-color: # ffffff;
Color: #336699;
SCROLLBAR-FACE-COLOR: # BED8EB;
SCROLLBAR-SHADOW-COLOR # DDF8FF;
SCROLLBAR-HIGHLIGHT-COLOR: #92C0D1;
SCROLLBAR-3DLIGHT-COLOR # DDF8FF;
SCROLLBAR-DARKSHADOW-COLOR: #92C0D1;
SCROLLBAR-TRACK-COLOR: # BED8EB;
SCROLLBAR-ARROW-COLOR: #92C0D1
}

Source: http://meego123.net /? Posting = 128

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.