Radio Button with rounded shadow on left in Chrome

空扰寡人 提交于 2019-12-11 13:04:38

问题


How do I make the radio button shadow to be rounded in Chrome like how it is displayed in IE? Any help will be appreciated!

IE: (like this)

CHROME: (not like this)

HTML:

<div class="radio"><input type="radio"><label>C#</label></div>    
<div class="radio"><input type="radio"><label>Java</label></div>  

CSS

input[type="radio"] {
    box-shadow: -4px 0 0 maroon; 
    border-radius: 10px;
}

JS FIDDLE:

http://jsfiddle.net/nikib/b85zpgu5/


回答1:


You could change the -webkit-appearance property of the input element to get initial or inherit. Then style is according to your need.

input[type="radio"] {
  width:15px;
  height:15px;
  box-shadow: -4px 0 0 maroon; 
  border-radius: 999px;
  -webkit-appearance: inherit;
  border:1px solid #999999;
  position:relative;
  box-sizing:border-box;
}
input[type="radio"]:checked:before {
  content:"";
  position:absolute;
  border-radius: 999px;
  left:25%;
  top:25%;
  width:50%;
  height:50%;
  background:#999999;
}

Updated Fiddle



来源:https://stackoverflow.com/questions/36904561/radio-button-with-rounded-shadow-on-left-in-chrome

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