要為每個(gè)啟用的元素設(shè)置樣式,請(qǐng)使用CSS的:enabled選擇器。
示例
您可以嘗試運(yùn)行以下代碼來(lái)為啟用的元素設(shè)置樣式
在線演示
<!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>
登錄后復(fù)制
以上就是使用 CSS 設(shè)置每個(gè)啟用元素的樣式的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注www.92cms.cn其它相關(guān)文章!






