Html 垂直居中单选按钮,并将其';s标签
我有这样的代码:Html 垂直居中单选按钮,并将其';s标签,html,css,Html,Css,我有这样的代码: <form method="post" id="sc_form"> <div class="radio-group"> <input type="radio" name="phone" id="send" value="send"></input> <label for="send">Вы отправитель</label>
<form method="post" id="sc_form">
<div class="radio-group">
<input type="radio" name="phone" id="send" value="send"></input>
<label for="send">Вы отправитель</label>
</div>
<div class="radio-group">
<input type="radio" name="phone" id="get" value="get"></input>
<label for="get">Вы получатель</label>
</div>
<input type="submit" name="send" value="Отправить" id="send-button" />
</form>
我想把收音机和标签放在同一条线上,这样它们看起来很漂亮,并且垂直居中
整个页面和css:像这样吗
我在.radio组类中添加了行高度,并通过输入和标签更改了垂直对齐
.radio-group{
text-align: left;
margin: 0 10px 6px 10px;
font-family: Arial,Helvetica,Garuda,sans-serif;
font-size: 11px;
line-height:11px;
}
input[type='radio'], label{
vertical-align: bottom;
margin: 0; //for the whole site.
}
这是我的工作
input[type='radio']{
margin:0;
}
input[type='radio'], label{
display:inline;
vertical-align:top;
}
аачааача)边距:0代码>在输入[type='radio']和标签中真正起作用。正如@Alexandre Diacov所建议的那样。将class
.radio
添加到单选按钮并将您的输入[type='radio']
选择器更改为输入[type='radio'],.radio
是有意义的,这样不理解属性css选择器的浏览器仍然会对齐标签。
input[type='radio']{
margin:0;
}
input[type='radio'], label{
display:inline;
vertical-align:top;
}