我创建了自己的自定义复选框样式,这些样式可以在Chrome浏览器中使用。但是它们不能在Edge或Firefox中使用。怎么了?
h5.roi-h5 {
color: #ffffff;
background-color: #999999;
padding: 10px !important;
text-align: center;
font-size: 20px;
clear: both;
margin-top: 20px;
margin-bottom: 20px;
}
.roi .roidivider {
height: 30px;
border-top: solid 1px #999999;
margin-top: 20px;
}
.roi .roilocations {
margin-bottom: 20px;
}
.roi-label {
background-color: #f2f2f2;
padding: 11px;
color: #999999;
display: inline-block;
vertical-align: middle;
}
.roi label {
color: #999999;
}
.roi .form-group {
height: 40px;
clear: both;
}
.roi .roiinfobox {
clear: both;
}
.roi input[type='number'] {
text-align: center;
color: #db291d;
}
.roi .summary {
display: none;
}
input.roisavings {
height: 200px;
border: 0px !important;
background-color: #f2f2f2;
color: #5f96aa;
font-weight: bold;
font-size: 35px;
text-align: center;
}
.roi .roifirstname input,
.roi .roilastname input,
.roi .roicompany input,
.roi .roiemail input {
border: 0px !important;
background-color: #f2f2f2;
}
.roi ::placeholder {
/* Chrome, Firefox, Opera, Safari 10.1+ */
color: #666F8F;
opacity: 1;
/* Firefox */
}
.roi :-ms-input-placeholder {
/* Internet Explorer 10-11 */
color: #666F8F;
}
.roi ::-ms-input-placeholder {
/* Microsoft Edge */
color: #666F8F;
}
.roi .form-control {
border: 1px solid #999999;
}
.roi input[type="checkbox"] {
cursor: pointer;
-webkit-appearance: none;
appearance: none;
background: #fff;
position: relative;
width: 40px;
height: 40px;
margin-right: auto;
margin-left: auto;
border: 1px solid #999999;
}
.roi input[type="checkbox"]:checked {
background-color: #ffffff;
content: "+";
}
.roi input[type="checkbox"]:checked:after {
background: url(https://svgshare.com/i/DMS.svg) no-repeat center center;
content: '';
left: 5px;
height: 28px;
width: 28px;
position: absolute;
top: 2px;
-webkit-transition: .2s opacity;
-o-transition: .2s opacity;
transition: .2s opacity;
}
.roi input[type="checkbox"]:focus {
outline: 0 none;
box-shadow: none;
}
.roi label[title]:after,
/* for Episerver < v8 */
.roi label[title]:after {
/* For Episerver v8+ */
background-color: #C9C9C9;
border-radius: 10px 10px 10px 10px;
border: 1px solid #ACACAC;
color: #FFFFFF;
content: "?";
/* make this whatever you want */
cursor: help;
display: inline-block;
font-size: 1em;
font-weight: bold;
height: 14px;
line-height: 14px;
margin: 0 0 0 5px;
text-align: center;
width: 14px;
}
.roi label[title=""]:after,
.roi label[title=""]:after {
display: none;
}
.roi label[title]:hover:after,
.roi label[title]:hover:after {
background-color: #A9A9A9;
border: 1px solid #9F9F9F;
}
.roi div label input {
/*margin-right: 100px;*/
}
.roi #ck-button {
margin: 4px;
background-color: #FFFFFF;
border-radius: 0px;
border: 1px solid #999999;
overflow: auto;
/*float: left;*/
text-align: center;
width: 100%;
}
.roi #ck-button input[type=radio] {
display: none;
}
.roi #ck-button label {
float: left;
width: 100%;
margin-bottom: 0px;
}
.col-sm-4.text-center.center-block {
padding-left: 4px;
padding-right: 4px;
}
.roi #ck-button label span {
text-align: center;
padding: 5px;
display: block;
color: #db291d;
}
.roi #ck-button label input {
position: absolute;
top: -20px;
}
.roi #ck-button input:checked+span {
background-color: #db291d;
color: #fff;
}
<div class="roi">
<div class="form-group">
<label title="test 1" class="control-label col-sm-10 roi-label">I am the caption 1</label>
<div class="col-sm-2">
<input type="checkbox" roiname="roiinput" name="locations" value="1" class="roicheckox form-control FormChoice__Input FormChoice__Input--Checkbox" checked data-f-datainput />
</div>
<label title="test 2" class="control-label col-sm-10 roi-label">I am the caption 2</label>
<div class="col-sm-2">
<input type="checkbox" roiname="roiinput" name="locations" value="2" class="roicheckox form-control FormChoice__Input FormChoice__Input--Checkbox" unchecked data-f-datainput />
</div>
</div>
</div>
Here is a fiddle观看所有操作。