【发布时间】:2019-09-21 03:47:51
【问题描述】:
我正在尝试让选中的复选框显示在我们的网站上。如果您转到此页面并选择定价计划:https://www.shiftdivorceguide.com/submit-listing/ 然后滚动到下一页的底部,我们有两个复选框,“我同意”和“已经有一个帐户”。
当我检查它们时,它们会消失,我希望它们显示为带有复选标记。
HTML 我同意复选框
<div class="checkbox form-group col-md-4 check_policy termpolicy">
<input id="policycheck" type="checkbox" name="policycheck" value="true">
<label for="policycheck">
<a target="_blank" href="https://www.shiftdivorceguide.com/terms-and-conditions/" class="help">I Agree</a>
</label>
</div>
CSS:
.checkbox input[type=checkbox] {
display: none;
}
.checkbox label:before { /*This is the css code for the existing checkbox*/
content: "";
display: inline-block;
width: 20px;
height: 20px;
top: 3px;
margin-right: 10px;
position: absolute;
left: 0;
bottom: 1px;
-webkit-transition: all 0.1s ease;
-moz-transition: all 0.1s ease;
-o-transition: all 0.1s ease;
transition: all 0.1s ease;
border-radius: 2px;
}
如果我将其更改为display:inline,则会显示第二个较小的框,如果我选中它,我同意它会跳到右侧。当我选中该框时,:Before 实例与屏幕上的框一起消失在代码中
我希望更好的大框(而不是小框)保留并在有人检查时显示为已选中。
谁能指出我如何解决这个问题的正确方向?
提前致谢!
【问题讨论】:
-
你能在这里添加一些代码吗?您可以在问题中添加
htmlcss代码,这可以显示实际的错误。 -
我看不到您在该页面底部所说的那些复选框!请添加一个包含最少代码的演示页面来描述问题
-
我在上面的帖子中添加了更多关于如何访问相关页面的代码和说明。