DHTML scroll bar settings

Source: Internet
Author: User
Tags html header
Since the appearance of DHTML, Microsoft has not stopped Strengthening the DHTML function. Many new style sheet contents have been added to IE, and modifications to the style of the scroll bar are also one of them, next we will briefly introduce the style sheet content that involves the browser's scroll bar:
1. settings for overflow content Overflow

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

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 specifies the color of the shadow of a three-dimensional scroll bar.

The values set in the preceding seven attributes are color values. You can use the expressions defined in the style sheet.

Using the above style definition content, we can specify whether or not the browser window and multi-line text box scroll bar display and color style, the first set of style attributes are used to set whether the set object shows the scroll bar, the second set of style attributes is used to set the color of the scroll bar. Note that all style attributes involved in this article are supported by IE. The second set of style attributes can only be supported by ie5.5 or a later version, so please pay attention when debugging.

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">

2. Set the scroll bar of the multi-line text box

No horizontal scroll bar

<Textarea style = "overflow-X: hidden"> </textarea>

No vertical scroll bar

<Textarea style = "overflow-Y: hidden"> </textarea>

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. When setting other elements, it is basically the same. You 'd better define a class in the style sheet file so that you can reuse it.

. Coolscrollbar

{

Scrollbar-arrow-color: yellow;

Scrollbar-base-color: lightsalmon;

}

Add the preceding statement to the style sheet file or the <style> </style> in the HTML header, and then use

<Textarea class = "coolscrollbar"> </textarea>

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.