The :in-range selector is used to selecting all elements that are given within a particular range value. It is mostly used in an input element with the type min/max attribute.
Syntax:
:in-range {
// CSS property
}
Example:
html
<!DOCTYPE html>
< html >
< head >
< title >in range selector</ title >
< style >
h1 {
color: green;
}
input:in-range {
border: 1px solid black;
background: green;
color: white;
}
body {
text-align: center;
}
</ style >
</ head >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >:in-range Selector</ h2 >
Select Number:
< input type = "number"
min = "20"
max = "40" >
</ body >
</ html >
|
Output:
Supported Browsers: The browser supported by :in-range selector are listed below:
- Apple Safari 5.1 and above
- Google Chrome 10.0 and above
- Edge 13.0 and above
- Firefox 29.0 and above
- Opera 11.0 and above
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
04 Aug, 2023
Like Article
Save Article