中心垂直radiobutton和它的标签

Val*_*ris 3 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>
     </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>
Run Code Online (Sandbox Code Playgroud)

CSS:

#get, #send{
  border: none;
  width: auto;
  height: auto;
  display: inline;
}

.radio-group{
  text-align: left;
  margin: 0 10px 6px 10px;
  font-family: Arial,Helvetica,Garuda,sans-serif;
  font-size: 11px;
}

input[type='radio'], label{   
    vertical-align: baseline;
}
Run Code Online (Sandbox Code Playgroud)

我想在同一条线上设置收音机和标签,这样它们看起来很漂亮,并且垂直居中.

http://jsfiddle.net/Zn93w/

整页和CSS:http://jsfiddle.net/2yZTK/

Ale*_*cov 9

这项工作对我来说

input[type='radio']{
    margin:0;
}

input[type='radio'], label{   
   display:inline;
   vertical-align:top;
}
Run Code Online (Sandbox Code Playgroud)

Удачи)

  • 将类`.radio`添加到单选按钮并将`input [type ='radio']`选择器更改为`input [type ='radio'],.radio`以及不理解属性css的浏览器是有意义的选择器仍然会对齐标签. (2认同)