我正在尝试增加标签中复选框的可点击区域。
但是,其中还有 2 个锚标签,当我尝试单击平板电脑上的复选框时,我会被重定向到超链接,因为复选框的可点击区域很小,但锚标签的区域更大。
我需要让它们都可以在平板电脑上点击,但也可以点击复选框。
这是当前的布局:
由于我也无法将 :before 作为 jQuery 上的 DOM 元素来处理,因此我也无法对其进行修改。有什么建议吗?
[type="checkbox"]:not(:checked)+label:before,
[type="checkbox"]:checked+label:before {
content: '';
position: absolute;
left: 0;
top: 1px;
width: 16px;
height: 16px;
border: 1px solid #000;
background: transparent;
}
<label class="form-label checkout-label">
<span class="form-label-forced-span">
I agree with the <a href="$url('Page-Show', 'cid', 'policy-link')$"
target="_blank" aria-label="confidentiality and protection
policy">confidentiality and protection policy</a> and <a href="$url('Page-
Show', 'cid', 'terms-and-uses')$" target="_blank" aria-label="the terms of use">the
terms of use</a>.
</span>
</label>
