The pseudo-class :read-only
should apply to any element that does not match the :read-write
selector, which means, any element that is not editable.
Well then, why is it that when I add disabled
to an input
element, the :read-only
pseudo-class doesn't apply to it?
.pseudo-test input:read-write {
color: blue;
}
.pseudo-test input:read-only {
color: red;
}
<div style="margin-top:10px" class="pseudo-test">
<form action="another-action.php">
<input type="search" value="What do you want to search for?" size="100" disabled>
</form>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…