Radio Button and Checkbox wonky behavior in Google Chrome

孤街浪徒 提交于 2019-12-24 03:19:33

问题


Within the past few months, Google has updated Chrome and I think has broken radio buttons and checkboxes on my website. I'm using version 31.0.1650.63

They work correctly in all other browsers I've tried (FF, Safari, IE9 & IE10). I haven't modified my CSS at all the last few months, so that's why I think it's an issue with Google Chrome.

I've created a simple jsFiddle that shows the behavior I'm talking about (and an external link to my CSS file):

http://jsfiddle.net/v22WB/

<input type="radio" name="sex" value="male">Male<br>
<input type="radio" name="sex" value="female">Female<br>
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car 

I've used Chrome's dev tools to disable all styles from the stylesheet but with no luck.

I'm using Twitter Bootstrap 2.0.2, but when I reference that file by itself, the radio buttons and checkboxes are normal. Any ideas?


回答1:


You've got this line in your stylesheet:

html body *:focus{outline-color:transparent;outline-style:none;-webkit-appearance:none}

The -webkit-appearance:none means input elements that have focus (ie a selected radio box or checkbox) aren't being displayed as input elements visually. See this link about customizing input styles. Take that out and your checkboxes should be back to normal.



来源:https://stackoverflow.com/questions/21033296/radio-button-and-checkbox-wonky-behavior-in-google-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!