pseudo-class
:in-range — CSS reference
Matches values within applicable numeric bounds. A separate constraint such as step can still make the control invalid.
Formal Syntax & Structure
css syntaxcss
:in-rangeWorking Example
Example Snippetcss
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Selector lab</title><style>:where(.sample) { color: rgb(32, 32, 32); }input:in-range { color: rgb(0, 96, 80); }</style></head><body><label>A <input id="a" class="sample" type="number" min="1" max="5" value="3"></label><label>B <input id="b" class="sample" type="number" min="1" max="5" value="9"></label></body></html>