我正在尝试使用 css3 伪元素设置单选按钮的样式。In 在 chrome 中效果很好,但它会跳回到 Firefox 中的默认样式。任何想法?
这是一个小提琴:JSFIDDLE
的HTML:
<input class="fancy" name="cc1" type="radio" checked/>
<input class="fancy" name="cc1" type="radio"/>
CSS:
input[type="radio"].fancy:before {
content:"";
width: 24px;
height: 24px;
background-color: #1f1f1f;
display: block;
border-radius: 50%;
position: relative;
top: -6px;
left: -6px;
box-shadow: 0 1px 2px rgba(255,255,255,.1),
inset 0 2px 2px rgba(0,0,0,.8);
}
input[type="radio"].fancy:checked:before {
visibility: visible;
content:"";
width: 24px;
height: 24px;
background-color: #1f1f1f;
display: block;
border-radius: 50%;
position: relative;
top: -6px;
left: -6px;
box-shadow: 0 1px 2px rgba(255,255,255,.2),
inset 0 2px 2px rgba(0,0,0,.8);
}
input[type="radio"].fancy:checked:after {
visibility: visible;
content:"";
width: 14px;
height: 14px;
display: block;
border-radius: 50%;
position: relative;
top: -25px;
left: -1px;
background: yellowgreen;
}
我试图避免背景图像