Chrome & Opera radio box-shadow is square - Any workaround?

亡梦爱人 提交于 2019-12-23 16:43:43

问题


Chrome and opera both have bug in the styling of radio inputs, so that the shadow appears around a square box, rather than the native element.

Firefox:

Chrome & Opera:

Does anyone know of a workaround for this, rather than just removing shadows for chrome & opera?


回答1:


Wrap the radio element in a div, and set that div's overflow to hidden, and border-radius to 100px. Then set the radio input to display block, and no margin.

<div class="radio_contain">
    <input type="radio" id="r1" name="r1">
</div>



.radio_contain {
  display: inline-block;
  border-radius: 100px;
  overflow: hidden;
  padding: 0;
}
.radio_contain input[type="radio"] {
  display: block;
  margin: 0;
}


来源:https://stackoverflow.com/questions/28140447/chrome-opera-radio-box-shadow-is-square-any-workaround

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