本文介绍了隐藏的单选按钮,但在ie8中围绕它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有我的单选按钮的背景图像样式,基本上我所做的是 < input type = radio:id =btnname =btnstyle =opacity:0; filter:alpha(opacity = 0); position:absolute;>
< label for =btn>我的文字< / label> <!---向其添加样式--->
用这个我得到的输出是这样的
Image1显示应该如何显示:http://i39.tinypic.com/2vcyidg.png
它在每个浏览器中工作正常,除了ie8,ie8在标签被选中时显示隐藏按钮周围的虚线框
Image2显示了ie8中的问题:http://i39.tinypic.com/j8l635.png
我不能选择属性display:none;在IE浏览器中,它禁用单选按钮,所以我必须隐藏它。
如何隐藏ie8中的虚线框?
谢谢。
问候,
Shishant Todi。
解决方案
如果您可以使用javascript:
< ; input:onfocus =this.blur()type =radioid =btnname =btnstyle =opacity:0; filter:alpha(opacity = 0); position:absolute; />
I have style my radio buttons with a background image, basically what i have done is
<input type="radio" id="btn" name="btn" style="opacity: 0;filter: alpha(opacity = 0);position:absolute;">
<label for="btn">My Text</label> <!--- added styles to it --->
with this i get output something like this
Image1 that shows how the display should be: http://i39.tinypic.com/2vcyidg.png
It works fine in every browser except ie8, in ie8 it shows a dotted box around hidden buttons when a label is selected
Image2 shows the problems in ie8: http://i39.tinypic.com/j8l635.png
I cant choose the property display:none; as in IE browsers it disables the radio buttons so i have to hide it.
How can i hide that dotted box in ie8?
Thank You.
Regards,
Shishant Todi.
解决方案
if you can use javascript:
<input onfocus="this.blur()" type="radio" id="btn" name="btn" style="opacity: 0;filter: alpha(opacity = 0);position:absolute;" />
这篇关于隐藏的单选按钮,但在ie8中围绕它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!