Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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
Html 垂直居中单选按钮,并将其';s标签_Html_Css - Fatal编程技术网

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