HTML scroll bar textarea attribute setting

HTML scroll bar textarea attribute setting
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

Recommend

Detailed explanation of Vue options

Table of contents 1. What are options? 2. What at...

Detailed explanation of Vue Notepad example

This article example shares the specific code of ...

WeChat applet implements text scrolling

This article example shares the specific code for...

Detailed explanation of using Baidu style in eslint in React project

1. Install Baidu Eslint Rule plugin npm i -D esli...

How to decrypt Linux version information

Displaying and interpreting information about you...

React hooks introductory tutorial

State Hooks Examples: import { useState } from &#...

Example code for converting Mysql query result set into JSON data

Mysql converts query result set into JSON data Pr...

Solution to the CSS height collapse problem

1. High degree of collapse In the document flow, ...

Detailed explanation of how to use Teleport, a built-in component of Vue3

Table of contents 1. Teleport usage 2. Complete t...

Vue.js manages the encapsulation of background table components

Table of contents Problem Analysis Why encapsulat...

Nginx reverse proxy configuration removes prefix

When using nginx as a reverse proxy, you can simp...

Restart all stopped Docker containers with one command

Restart all stopped Docker containers with one co...

JavaScript commonly used array deduplication actual combat source code

Array deduplication is usually encountered during...

How to view mysql binlog (binary log)

For example, when you create a new table or updat...