要為每個啟用的元素設置樣式,請使用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>
登錄后復制
以上就是使用 CSS 設置每個啟用元素的樣式的詳細內容,更多請關注www.92cms.cn其它相關文章!