Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css html单选按钮在所有浏览器中的样式相同_Css_Html_Radio Button - Fatal编程技术网

Css html单选按钮在所有浏览器中的样式相同

Css html单选按钮在所有浏览器中的样式相同,css,html,radio-button,Css,Html,Radio Button,如何在所有浏览器中获得相同样式的输入type=“radio”。我试图得到3个单选按钮,从左到右访问整个页面的单选按钮和文本在所有IE9,铬,和FF使用css居中。我正在使用所有不同的类型或垂直对齐和填充,这在一些浏览器上有效,但不是所有浏览器都有效 <input class="text-bottom" type="radio" value="1" name="ProcessingComplete">Works in FF & Chrome <input class="

如何在所有浏览器中获得相同样式的输入type=“radio”。我试图得到3个单选按钮,从左到右访问整个页面的单选按钮和文本在所有IE9,铬,和FF使用css居中。我正在使用所有不同的类型或垂直对齐和填充,这在一些浏览器上有效,但不是所有浏览器都有效

<input class="text-bottom" type="radio" value="1"  name="ProcessingComplete">Works in FF & Chrome
<input class="middle" type="radio" value="1"  name="ProcessingComplete">Works in IE
<input class="top" type="radio" value="1"  name="ProcessingComplete">Works in FF & Chrome

.middle
{
vertical-align: middle;
}
.top
{
vertical-align: top;
}
.text-bottom
{
vertical-align:text-bottom;
}
适用于FF和Chrome
在IE工作
在FF&Chrome工作
中间的
{
垂直对齐:中间对齐;
}
顶部
{
垂直对齐:顶部;
}
.文本底部
{
垂直对齐:文本底部;
}

正如Dario on所指出的,尝试以下方法:

input[type="radio"] {
  margin-top: -1px;
  vertical-align: middle;
}
此外,请记住,最好使用
标签包装单选按钮标签


请参阅。

正如Dario on所指出的,尝试以下方法:

input[type="radio"] {
  margin-top: -1px;
  vertical-align: middle;
}
此外,请记住,最好使用
标签包装单选按钮标签


请看。

对不起,正如我说的,我使用的是垂直对齐并使用填充,但不幸的是,我无法使用填充来产生任何真正的差异是的,这很粗糙。如果它真的很重要,你可能想考虑用你自己的自定义元素来替换单选按钮(如许多其他地方)。不幸的是,我只是尝试为其他人的MVC项目代码设计样式,所以不确定是否可以将单选按钮更改为自定义元素,正如我所说,我使用垂直对齐并使用填充,但不幸的是,我无法获得填充来实现任何真正的差异是的,这很粗糙。如果它真的很重要,你可能想考虑用你自己的自定义元素来替换单选按钮(如许多其他地方)。不幸的是,我只是尝试从MVC项目中为其他人的代码设计样式,所以不确定是否可以将单选按钮更改为自定义元素