我正在尝试将 HTML 5 required
复选框集成到表单中:
<p>
<input class="checkbox" type="checkbox" required name="terms"> By submitting you agree to the processing of your data for the purpose of processing your request/booking.
<br>
<a href="/en/datenschutz.php" target="_blank">
<u>Privacy Policy</u>
</a>
</p>
它没有在单个浏览器中显示。我以前在其他网站上没有遇到过这个问题,这个网站运行的是 Bootstrap v2.2.2。
我找到了一些可能的解决方案,但标签不起作用。
最佳答案
你的 Style.css 文件有这个规则:
input[type="checkbox"] {
display: none;
}
删除它,您将看到您的复选框。
如果您出于某种原因需要该规则,并且只想为这个特定的复选框覆盖它,那么您必须添加另一个 CSS 规则来覆盖它。显然,添加内联样式就可以完成这项工作,但这可能不是最好的方法:
<input class="checkbox" type="checkbox" required name="terms" style="display: inline-block;">
关于css - 复选框不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50374266/