Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

บทบาทของ CSS:ตัวเลือกนอกช่วง


ใช้ตัวเลือก CSS :out-of-range เพื่อจัดรูปแบบ องค์ประกอบที่มีค่านอกช่วงที่ระบุ

ตัวอย่าง

คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน :out-of-range selector

<!DOCTYPE html>
<html>
   <head>
      <style>
         input:out-of-range {
            border: 3px dashed orange;
            background: yellow;
         }
      </style>
   </head>
   <body>
      <input type = "number" min = "5" max = "10" value = "15">
      <p>The style only works for the value entered out of range</p>
   </body>
</html>