单选按钮在 ie 和 chrome 中消失
下面是样式表
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是因为您已经告诉单选按钮高度为 0% - 即 0px - 但它不存在。
您可以通过将高度和宽度设置为“自动”来覆盖它,这将重置它们(除非样式表中的其他地方有更具体的规则)
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 类中的“width:0%;height:0%”。 你需要一个宽度和高度。
尝试这个:
My guess is the "width:0%;height:0%" in your input.myradio class. you need a width and height.
Try this:
为什么将它们的高度和宽度指定为 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.
您需要将单选按钮放在
You need to put your radio button within
<form>
tag and they will appear in Chrome and IE: