复选框&单选按钮渲染问题 [英] checkbox & radio button rendering issue
问题描述
我正在创建一个带有几个复选框和单选按钮的MVC 5页面。当我在Microsoft Edge中显示它时,复选框和按钮不会呈现,只是文本。当我在IE 11中显示相同的页面时,它们呈现正常。可能导致这种情况的任何想法吗?
更新:我已经在逻辑上证明这是由css文件中的某些内容引起的。如果我删除文件页面呈现(当然,没有所有格式),复选框和单选按钮就在那里并且功能正常。
I am creating an MVC 5 page with several checkboxes and radio buttons. When I display it in Microsoft Edge the checkboxes and buttons don't render, just the text. When I display the same exact page in IE 11 they render fine. Any ideas what might cause this?
Update: I have proven logically that this is caused by something in the css file. If I eliminate the file the page renders (of course, without all the formatting) and the checkboxes and radio buttons are there and functional.
推荐答案
在我的css文件中声明:
In my css file I had put the statement:
form input, form select, form textarea {
-webkit-appearance: none;
}
当我注释掉这个声明一切正常。
When I commented out this statement everything works.
_webkit-appearance显然与Edge,谷歌(以及其他任何人)想要对小盒子和按钮进行风格化。如果在css中包含-webkit-appearance:none,它会关闭框和按钮的整个渲染。
我现在测试了Edge,Chrome和Firefox以及删除此语句已解决所有这些问题。
_webkit-appearance apparently has to do with Edge, Google (and whoever else) wanting to stylize the little boxes and buttons. If you include -webkit-appearance: none in the css it turns off the entire rendering of the boxes and buttons.
I have now tested Edge, Chrome and Firefox and removing this statement has fixed the problem for all of them.
这篇关于复选框&单选按钮渲染问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!