6

下面是样式表

 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

4 回答 4

8

这是因为您已将单选按钮设置为 0% 高 - 即 0px - 不存在。

您可以通过将高度和宽度设置为“自动”来覆盖它,这将重置它们(除非在样式表的其他地方有更具体的规则)

input.myradio {
  border:none;
  width:auto;
  height:auto;
}
于 2009-06-17T18:23:50.403 回答
3

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

试试这个:

input.myradio {border:none;width:1em;height:1em;}
于 2009-06-17T18:20:59.457 回答
1

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

于 2009-06-17T18:20:33.230 回答
-2

您需要将单选按钮放在<form>标签内,它们将出现在 Chrome 和 IE 中:

<form><input type="radio" /></form>
于 2012-02-16T10:28:11.667 回答