CSS :enabled 選擇器的作用


使用 CSS :enabled 選擇器為每個已啟用的 <input> 元素設定樣式。你可以嘗試執行下面的程式碼來實現 :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>

更新時間: 30-Jun-2020

156 次瀏覽

開啟你的 職業生涯

完成課程,獲得認證

開始學習
© . All rights reserved.