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

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


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

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <style>
         input:enabled {
            background: blue;
         }
         input:disabled {
            background: red;
         }
      </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>