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

บทบาทของ CSS :เปิดใช้งาน Selector


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

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <style>
         input:enabled {
            background: blue;
         }
      </style>
   </head>
   <body>
      <form action = "">
         Subject <input type = "text" name = "subject"><br>
         Student: <input type = "text" name = "student"><br>
         Age: <input type = "number" name = "age" disabled><br>
      </form>
   </body>
</html>