以下是样式表

 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没有显示单选按钮?为什么这样?

有帮助吗?

解决方案

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

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

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

其他提示

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

试试这个:

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

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

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

<form><input type="radio" /></form>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top