单选按钮在ie和chrome中消失

时间:2009-06-17 18:17:05

标签: html css internet-explorer google-chrome radio-button

以下是样式表

 select,input ,td a {border:1px solid green; width:25%;height:25px;font-size:20px;margin-  left:.1em;}
input.myradio {border:none;width:0%;height:0%;font-size:0%;}

以下是html

<td><input class="myradio"  type="radio" name="poolstatus" value="Add">Add</input><td>

它在Firefox中是完美的,但Chrome和IE没有显示单选按钮?为什么这样?

4 个答案:

答案 0 :(得分:7)

这是因为你告诉单选按钮高0% - 这是0px - 这不存在。

你可以通过告诉高度和宽度为'auto'来重置它们,这将重置它们(除非在样式表的其他地方有更具体的规则)

input.myradio {
  border:none;
  width:auto;
  height:auto;
}

答案 1 :(得分:3)

我的猜测是你的input.myradio类中的“width:0%; height:0%”。你需要一个宽度和高度。

试试这个:

input.myradio {border:none;width:1em;height:1em;}

答案 2 :(得分:1)

为什么你的高度和宽度指定为0%?我猜这就是IE和Chrome没有显示单选按钮的原因,因为它们的大小为0像素。

答案 3 :(得分:-2)

您需要将单选按钮放在<form>标记内,它们将显示在Chrome和IE中:

<form><input type="radio" /></form>
相关问题