Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

Firefox

Chrome & Opera:

Chrome

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

like image 452
Olirav Avatar asked Jan 17 '26 22:01

Olirav


1 Answers

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;
}
like image 58
Ed Wright Avatar answered Jan 20 '26 10:01

Ed Wright