【发布时间】:2018-11-09 23:05:12
【问题描述】:
所以,我得到了我的自定义 CSS3 单选按钮,它们在我的网站上看起来很棒。他们在 Firefox 中工作,根据我的阅读,他们应该在大多数现代浏览器中工作。但是,在我的手机(Android 4.3 的 Galaxy Nexus)上,虽然它们在 Chrome 中完美运行,但在默认的香草浏览器上却无法运行(无法点击)。我怀疑 Internet Explorer 的各种版本也很可能存在问题(似乎一直存在)。
我找到了a great article about browser support for custom radio buttons,但在所有标记出来的文本和各种更新之间,我无法弄清楚我的按钮到底出了什么问题以及最简单的解决方案是什么。
在我看来,其他人可能会遇到同样的问题,所以我已经包含了我的代码,希望你能帮助我深入了解这个问题,并且这个主题可能会在未来为其他人指明正确的方向.感谢您的宝贵时间。
这是我的代码:
input[type=radio] {
display:none;
}
input[type=radio] + label:before {
content: "";
display: inline-block;
width: 15px;
height: 15px;
vertical-align:middle;
margin-right: 8px;
background-color: #aaa;
border-radius: 8px;
margin-top: -3.5px;
margin-left: 5%;
}
input[type=radio]:checked + label:before {
content: ""; /* just change color, no bullet */
background-color: #24bbff;
text-align:center;
line-height:14px;
}
【问题讨论】:
标签: css cross-browser radio-button