css伪类选择器-表单相关【:checked】css⾼级选择器-伪类选择器:
:checked
css的选择器-伪类选择器
选择器语法Eg规则
checked input :checked {属性:值;}input:checked {color:red;}匹配每个选中的输⼊元素(仅适⽤于单选按钮或复选框)  css选择器表单相关⼩例⼦
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>:checked</title>
<style type="text/css">
input:checked+label{
color: yellow;
background-color: darkcyan;
border-radius: 5px;
}
如何用css美化表单
</style>
</head>
<body>
<div>
<div>这⾥是checked</div>
<input type="radio" name="gender" id="man" value="1" />
<label for="man">BOY</label>
<input type="radio" name="gender" id="woman" value="0"/>
<label for="woman">GIRL</label>
</div>
</body>
</html>
css选择器表单相关⼩例⼦效果

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。