在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ ie8中相鄰兄弟選擇器樣式無(wú)效

ie8中相鄰兄弟選擇器樣式無(wú)效

用label標(biāo)簽美化radio和checkbox,在寫checked時(shí)label更換背景圖,效果在主流瀏覽器都沒(méi)問(wèn)題但是在ie8中就是無(wú)效,監(jiān)聽(tīng)時(shí)radio和checkbox確實(shí)是checked狀態(tài),可是樣式就是不出來(lái),煩弄大半天了也沒(mé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>臨時(shí)專家?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覽器對(duì)CSS3的兼容。

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

2018年3月17日 21:53