【发布时间】:2025-12-16 08:10:02
【问题描述】:
当点击DIV标签时,这个HTML是否可以让DIV标签不检查输入复选框标签?我可以添加任何 CSS 来实现这一点吗?
<style>
#myId ~ label {
position: fixed;
overflow: auto;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: red;
}
#myId ~ label div {
width: 100%;
background-color: yellow;
height: 25%;
}
#myId:checked ~ label {
display: none;
}
</style>
<input id="myId" type="checkbox" />
<label for="myId">
<div>Hello</div>
</label>
【问题讨论】: