gpt4 book ai didi

html - 复选框中不需要的点

转载 作者:行者123 更新时间:2023-11-28 02:52:45 30 4
gpt4 key购买 nike

由于我的 CSS 样式,我的复选框中出现了一个不需要的点。我不确定如何删除它或导致它的原因。

这是它所在站点的链接: JavaJam Coffee House

Newsletter 标题下方的表格是网站中与该问题相关的唯一部分。请注意复选框左上角的小点。

非常感谢有关此问题的任何提示或见解。

与问题相关的 HTML 代码:

<input type=checkbox name="coupon" id="coupon">
<label for="coupon" class="check"><span>Include coupons</span></label>
<br><br>
<input type=checkbox name="magazine" id="magazine">
<label for="magazine" class="check"><span>Include magazines</span></label>
<br><br>
<input type=checkbox name="certificates" id="certificates">
<label for="certificates" class="check"><span>Include gift certificates</span></label>
<br><br>
<input type="submit" value="Register">
<br><br>

与问题相关的 CSS 代码:

input[type=checkbox] + label {
cursor: pointer;
}

label span {
vertical-align: middle;
}

input[type=checkbox] {
position: absolute;
height: 1px;
width: 1px;
vertical-align: middle;
clip: rect(0 0 1 1);
}

input[type=checkbox] + label::before {
content: "\00a0"; /* non-line breaking space */
display: inline-block;
width:12px;
height: 12px;
text-align: center;
line-height: 1em;
font-size: 0.8em;
margin-right: 10px;
border: 0.125em solid #680000;
background-color: white;
vertical-align: middle;
}

input[type=checkbox]:checked + label::before {
content: "\2713"; /*checkmark */
color: #680000;
background: white;
}

最佳答案

尝试编辑此样式

    input[type=checkbox] {
position: absolute;
/* height: 1px; */
/* width: 1px; */
left: -2000px;
vertical-align: middle;
clip: rect(0 0 1 1);
}

我评论了宽度和高度,因为它们是点首先出现的原因,并添加了一个 left 属性以将输入发送到屏幕外

关于html - 复选框中不需要的点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46591706/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com