简体   繁体   English

为什么我的 HTML 复选框在移动设备上不起作用?

[英]Why doesn't my HTML checkbox work on mobile devices?

I have a website and my users are not able to click my checkbox on mobile devices.我有一个网站,但我的用户无法在移动设备上单击我的复选框。 I have searched online and can not find a solution to this problem.我在网上搜索过,找不到解决此问题的方法。

 .jg-c-register_label { display: grid; } .jg-c-register_label-text { color: #001e4b; margin-bottom: 15px; }
 <label class="jg-c-register_label"> <span class="jg-c-register_label-text" style="margin-bottom: -5px; padding-top: 10px;"> <input type="checkbox" id="giftAid" name="giftAid" style="-webkit-appearance: auto;display: inline-block;"> I am a UK Tax Payer. I want to Gift Aid this donation and any future donation I make on this platform until further notice. </span> </label>

Replace -webkit-appearance: auto;替换-webkit-appearance: auto; with -webkit-appearance: checkbox;带有-webkit-appearance: checkbox; for the checkbox.对于复选框。 It should work.它应该工作。

The checkbox does not work for my desktop also.该复选框也不适用于我的桌面。

PS: Why have you put -webkit-appearance: none; PS:你为什么要放-webkit-appearance: none; and display: none kind of css properties when you have no custom css for you checkbox.display: none当您没有自定义 css 复选框时, display: none种类的 css 属性。 Plus there is a lot of duplicate css in your code.此外,您的代码中有很多重复的 css。 Your default.css, global.css, normalize.css has same lines of code... Why...?????你的 default.css、global.css、normalize.css 有相同的代码行......为什么......????

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM