1. Overflow content overflow settings (set whether the set object displays a scroll bar) overflow-x setting for horizontal content overflow overflow-y settings for vertical content overflow The above three properties are set to visible (default value), scroll, hidden, and auto. 2. scrollbar-3d-light-color The color of the bright edge of the three-dimensional scroll bar (set the color of the scroll bar) scrollbar-arrow-colorThe color of the triangle arrow on the up and down buttons scrollbar-base-color The basic color of the scrollbar scrollbar-dark-shadow-color The color of the strong shadow of the three-dimensional scroll bar scrollbar-face-color The color of the protruding part of the three-dimensional scroll bar scrollbar-highlight-color The color of the blank part of the scrollbar scrollbar-shadow-color The color of the three-dimensional scroll bar shadow. We use several examples to explain the above style attributes: 1. Make sure that the browser window never has scroll bars <br />No horizontal scroll bar Copy code The code is as follows:<body style="overflow-x:hidden"> No vertical scroll bar Copy code The code is as follows:<body style="overflow-y:hidden"> No scroll bars Copy code The code is as follows:<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 Copy code The code is as follows:<textarea style="overflow-x:hidden">< /textarea> No vertical scroll bar Copy code The code is as follows:< textarea style="overflow-y:hidden">< /textarea> No scroll bars Copy code The code is as follows:<textarea style="overflow-x:hidden;overflow-y:hidden">< /textarea> or < textarea style="overflow:hidden"></textarea> 3. Set the color of the window scroll bar <br />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 one property to change the scroll bar color. Add a little special effect: Copy code The code is as follows:<body style="scrollbar-arrow-color:yellow;scrollbar-base-color:lightsalmon"> 4. Define a class in the style sheet file and call the style sheet Copy code The code is as follows:<style> .coolscrollbar{scrollbar-arrow-color:yellow;scrollbar-base-color:lightsalmon;} </style> Call it like this: Copy code The code is as follows:<textarea class="coolscrollbar">< /textarea> Textarea color and border settings: Copy code The code is as follows:<textarea style="border:red solid;border-width:1 1 1 1;color:#CCCCCC;">< /textarea> |
<<: Use the CSS border-radius property to set the arc
>>: JavaScript Basics Operators
Table of contents 1. What are options? 2. What at...
This article example shares the specific code of ...
This article example shares the specific code for...
1. Install Baidu Eslint Rule plugin npm i -D esli...
Displaying and interpreting information about you...
State Hooks Examples: import { useState } from ...
Mysql converts query result set into JSON data Pr...
transform and translate Transform refers to trans...
1. High degree of collapse In the document flow, ...
Table of contents 1. Teleport usage 2. Complete t...
Table of contents Problem Analysis Why encapsulat...
When using nginx as a reverse proxy, you can simp...
Restart all stopped Docker containers with one co...
Array deduplication is usually encountered during...
For example, when you create a new table or updat...