out-of-range

CSS :out-of-range Pseudo Class

The :out-of-range pseudo-class styles the elements that have range limitations when the value of the element is outside the specified range.

The :out-of-range selector only works for <input> elements with min and/or max attributes. (和/或最大属性。)

Version

Version (版本)

Selectors Level 4 (选择器级别4)

Syntax

Syntax (语法)

:out-of-range {
 css declarations;
}

Example of the :out-of-range selector:

<!DOCTYPE html>
<html>
 <head>
   <title>Title of the document</title>
   <style>
     input:out-of-range {
       border: 3px solid #8ebf42;
     }
   </style>
 </head>
 <body>
   <h2>:out-of-range selector example</h2>
   <form>
     <input type="number" min="1" max="12" value="15">
   </form>
 </body>
</html>


请遵守《互联网环境法规》文明发言,欢迎讨论问题
扫码反馈

扫一扫,反馈当前页面

咨询反馈
扫码关注
返回顶部