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

บทบาทของ CSS :In-range Selector


ใช้ตัวเลือก CSS :in-range เพื่อจัดรูปแบบองค์ประกอบ ด้วยค่าภายในช่วงที่ระบุ คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน :in-range selector -

ตัวอย่าง

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