Set scroll color in CSS

Source: Internet
Author: User
Direct sticking Code Pull, this only applies to IE Reprinted please specify http://netsos.cnblogs.com/ Div
{
Scrollbar-3dlight-color: #000000;
Scrollbar-Highlight-color: # cccccc;
Scrollbar-face-color: #000000;
Scrollbar-arrow-color: # ffffff;
Scrollbar-shadow-color: #666666;
Scrollbar-darkshadow-color: #999999;
Scrollbar-track-color: # dddddd;
Height: 100px;
Width: 400px;
Padding: 100px 0 0 0;
Border: 1px solid #666666;
Overflow: Scroll;
}
</ Style >
</ Head >
 
< Body >  
< Div > Here is the element content section < BR /> Here is the element content section < BR /> Here is the element content section < BR /> Here is the element content section < BR /> Here is the element content section < BR /> Here is the element content section < BR /> Here is the element content section < BR /> Here is the element content section < BR /> </ Div >
</ Body >

Firefox hasn't tried it yet. Check it out.

 

Force Firefox to display the scroll bar:

Method 1: HTML {overflow:-moz-scrollbars-vertical ;}

Method 2: HTML {Min-Height: 101% ;}

Why do I need to force a scroll bar? In Firefox, you will find that there is no scroll bar when the page is not fully loaded. the scroll bar is displayed only after the page is loaded, so you will feel that the page is offset.

 Reprinted please specify http://netsos.cnblogs.com/

Another method: Use jquery

 

< Script Type = "Text/JavaScript" SRC = Jquery-1.1.3.1.js" > </ Script >
< Script Type = "Text/JavaScript" SRC = "Jquery. linscroll. js" > </ Script >

< Script Type = "Text/JavaScript" >
$ (Document). Ready (
Function (){
$ ('# Smscontent'). setscroll ( // You can control the Display Based on the div id and class.
{IMG: 'scroll_bk.gif ', width: 10 }, // Background-image and width
{IMG: 'scroll_arrow_up.gif ', height: 3 }, // Up Image
{IMG: 'scroll_arrow_down.gif ', height: 3 }, // Down Image
{IMG: 'scroll_bar.gif ', height: 25 } // Bar Image
);
}
);

</ Script >

HTML code:

<DivID= "Smscontent"Style= "Width: 140px; overflow: hidden; Height: 170px ;">
A hacker claimed that he had cracked Apple CE's self-proclaimed "orin0co ". he said he obtained Steve Jobs's account and password on Amazon through fish fishing. according to history, Steve Jobs has purchased 20 thousand vendors on Amazon over the past 10 years.
 </Div>

The biggest benefit of this plug-in is that you can customize the style of the scroll bar and process several images by yourself. In addition, when the content of the DIV does not exceed the pre-set height, no scroll bar will appear.

 

Http://blog.gaoso.com.cn/2009/05/401.html let me download, it seems to charge a dime, Ai !~~~~~~~~~~~~

 Reprinted please specify http://netsos.cnblogs.com/

There is another one that relies on from other forums.

Put it in a CSS file

@-Moz-document URL-prefix (http: //), URL-prefix (https ://){
/* Scroll bar color */
Scrollbar {
-Moz-appearance: none! Important;
Background: #00ff00! Important;
}

/* Color of the scroll bar button */
Thumb, scrollbarbutton {
-Moz-appearance: none! Important;
Background-color: # 0000ff! Important;
}

/* Button color when hovering over the mouse */
Thumb: hover, scrollbarbutton: hover {
-Moz-appearance: none! Important;
Background-color: # ff0000! Important;
}

/* Hide the up and down arrows */
Scrollbarbutton {
Display: none! Important;
}

/* Width of the vertical scroll bar */
Scrollbar [Orient = "vertical"] {
Min-width: 15px! Important;
}
}

 Reprinted please specify http://netsos.cnblogs.com/

 

 

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.