单选按钮在 ie 和 chrome 中消失

发布于 2024-07-24 08:57:02 字数 411 浏览 4 评论 0原文

下面是样式表

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

The below is in style sheet

 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%;}

The below is in html

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

It's perfect in firefox but chrome and IE are not showing radio buttons? Why so?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

花开浅夏 2024-07-31 08:57:02

这是因为您已经告诉单选按钮高度为 0% - 即 0px - 但它不存在。

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

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

It's because you have told the radio button to be 0% tall - which is 0px - which is not there.

You can override this by telling the height and width to be 'auto' which will reset them (unless there's a rule which is more specific somewhere else in the stylesheet)

input.myradio {
  border:none;
  width:auto;
  height:auto;
}
一百个冬季 2024-07-31 08:57:02

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

尝试这个:

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

My guess is the "width:0%;height:0%" in your input.myradio class. you need a width and height.

Try this:

input.myradio {border:none;width:1em;height:1em;}
海之角 2024-07-31 08:57:02

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

Why do you have a height and width specified of 0% for them? I'm guessing that is why IE and Chrome are not showing the radio button,s because they have a size of 0 pixels.

や三分注定 2024-07-31 08:57:02

您需要将单选按钮放在

标记内,它们将出现在 Chrome 和 IE 中:

<form><input type="radio" /></form>

You need to put your radio button within <form> tag and they will appear in Chrome and IE:

<form><input type="radio" /></form>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文