gpt4 book ai didi

html - 复选框和单选按钮在 IE7 中显示不完美?

转载 作者:太空宇宙 更新时间:2023-11-04 15:59:41 25 4
gpt4 key购买 nike

我正在用纯 css 创建自定义复选框和单选按钮,但它们在 IE7 中显示不完美。

任何 body 帮助

有验证码吗

HTML

<ul>
<li>
<fieldset>

<legend id="title1" class="desc">
Select a Choice
</legend>

<div>
<span>
<input id="Field1_0" name="Field1" type="radio" class="field radio" checked="checked">
<label class="choice" for="Field1_0">
First Choice</label>
</span>
<span>
<input id="Field1_1" name="Field1" type="radio" class="field radio">
<label class="choice" for="Field1_1">
Second Choice</label>
</span>
<span>
<input id="Field1_2" name="Field1" type="radio" class="field radio">
<label class="choice" for="Field1_2">
Third Choice</label>
</span>
</div>
</fieldset>
</li>


<li>
<fieldset>

<legend id="title2" class="desc">
Check All That Apply
</legend>

<div>
<span>
<input id="Field2" name="Field2" type="checkbox" class="field checkbox" checked="checked">
<label class="choice" for="Field2">First Choice</label>
</span>
<span>
<input id="Field3" name="Field3" type="checkbox" class="field checkbox">
<label class="choice" for="Field3">Second Choice</label>
</span>
<span>
<input id="Field4" name="Field4" type="checkbox" class="field checkbox">
<label class="choice" for="Field4">Third Choice</label>
</span>
</div>
</fieldset>
</li>
</ul>​

CSS

li:not(#foo) > fieldset > div > span > input[type='radio'],
li:not(#foo) > fieldset > div > span > input[type='checkbox']
{
opacity: 0;
float: left;
width: 18px;
}

li:not(#foo) > fieldset > div > span > input[type='radio'] + label,
li:not(#foo) > fieldset > div > span > input[type='checkbox'] + label {
margin: 0;
clear: none;
padding: 5px 0 4px 24px;
/* Make look clickable because they are */
cursor: pointer;
background: url(https://css-tricks.com/wufoo/themes/customradiosandcheckboxes/off.png) left center no-repeat;
}

li:not(#foo) > fieldset > div > span > input[type='radio']:checked + label {
background-image: url(https://css-tricks.com/wufoo/themes/customradiosandcheckboxes/radio.png);
}
li:not(#foo) > fieldset > div > span > input[type='checkbox']:checked + label {
background-image: url(https://css-tricks.com/wufoo/themes/customradiosandcheckboxes/check.png);
}​

Live demo here http://jsfiddle.net/rohitazad/Vsvg2/79/

最佳答案

:checked 是css3的属性,IE8及以下浏览器不支持。但是你可以用 http://selectivizr.com/ 来实现。支持IE所有css3伪选择器的JS

关于html - 复选框和单选按钮在 IE7 中显示不完美?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9987017/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com