鍍金池/ 問答/HTML/ ie8中相鄰兄弟選擇器樣式無效

ie8中相鄰兄弟選擇器樣式無效

用label標(biāo)簽美化radio和checkbox,在寫checked時label更換背景圖,效果在主流瀏覽器都沒問題但是在ie8中就是無效,監(jiān)聽時radio和checkbox確實是checked狀態(tài),可是樣式就是不出來,煩弄大半天了也沒找到答案,愁死了.
html:

<div class="radio">
                <div>
                    <input type="radio" name="library" id="radio1" class="hide" checked="true" />
                    <label for="radio1"><span>認(rèn)證專家?guī)?lt;/span></label>
                </div>
                <div>
                    <input type="radio" name="library" id="radio2" class="hide"/>
                    <label for="radio2"><span>臨時專家?guī)?lt;/span></label>
                </div>
            </div>

css:
.radio label {

display: inline-block;
height: 30px;
line-height: 30px;
background: url(../images/radio.png) no-repeat 0 center;
padding-left: 28px;
cursor: pointer;

}

.radio label:hover {

background-image: url(../images/radio-h.png);
color: #18b1ea;

}

.radio input[type=radio]:checked + label {

background-image: url(../images/radio-on.png);
color: #18b1ea;

}

回答
編輯回答
裸橙

IE8是不支持":checked", 你可以查詢?yōu)g覽器對CSS3的兼容。

:checked的兼容性
Selectivizr-讓IE6~8支持CSS3偽類和屬性選擇器

2018年3月17日 21:53