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

จัดรูปแบบทุกองค์ประกอบ ที่เปิดใช้งานด้วย CSS


หากต้องการจัดรูปแบบทุกองค์ประกอบ ที่เปิดใช้งาน ให้ใช้ตัวเลือก CSS :enabled

ตัวอย่าง

คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อเปิดใช้งาน องค์ประกอบ

<!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>