【发布时间】:2019-07-24 02:28:59
【问题描述】:
我创建了一个单选列表动画,它适用于除 ie11 和 edge 之外的所有浏览器。我在网上搜索了解决方案,但无法解决此兼容性问题。我希望有人能够提供带有解释的解决方案。我已经包含了下面的所有代码。
.vertical-radio-buttons div {
display: block;
padding: 0 0 5px 5px;
clear: both
}
.vertical-radio-buttons span {
display: block;
padding-left: 0.8rem;
cursor: inherit;
}
.vertical-radio-buttons label {
font-size: rem-calc(16);
}
.vertical-radio-buttons input {
float: left;
width: 0.8rem;
margin-left: -.08rem;
}
fieldset {
border-color: transparent;
}
/*new*/
.wrapper {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: verdana;
}
label {
text-shadow: 0px 0px 1px 1px rgba(0, 0, 0, .1);
}
input[type="radio"] {
appearance: none;
-webkit-appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
vertical-align: middle;
margin-bottom: 5px;
position: relative;
cursor: pointer;
outline: 0;
overflow: hidden;
}
input [type="radio"]::-ms-expand {
display: none;
}
input[type="radio"]:after {
position: absolute;
content: "";
top: 50%;
left: 50%;
border-radius: 50%;
transition: all .1s;
}
/* type_1 */
.type_1 {
border: 2px solid #000;
}
.type_1:after {
border: 5px solid goldenrod;
transform: translate3d(50%, 50%, 0);
}
.type_1:checked:after {
transform: translate3d(-50%, -50%, 0);
}
/* type_2 */
.type_2 {
border: 2px solid #000;
}
.type_2:after {
border: 5px solid #000;
transform: translate3d(-50%, -50%, 0) scale(0, 0);
}
.type_2:checked:after {
transform: translate3d(-50%, -50%, 0) scale(1, 1);
}
<div class="vertical-radio-buttons">
<fieldset>
<form>
<div><span><input class="type_1" type="radio" name="option1" checked><label for=""> How about once a week? Let's take it slow</label></span></div>
<div><span><input class="type_1" type="radio" name="option1"><label for=""> How about a few times a month? Sound about right?</label></span></div>
<div><span><input class="type_1" type="radio" name="option1"><label for=""> Once a month? I'd be okay with that. OK.</label></span></div>
<div><span><input class="type_1" type="radio" name="option1"><label for=""> It's not you. It's me. How about a small break? 30-Days?</label></span></div>
<div><span><input class="type_1" type="radio" name="option1"><label for=""> Unsubscribe? Are you sure it's over? "Sniff"</label></span></div>
</form>
</fieldset>
</div>
【问题讨论】:
标签: css radio-button css-animations internet-explorer-11 microsoft-edge