2014-08-28 82 views
0

内嵌我在JsFiddle单选按钮不与标签

<form> 
    <div style="margin:0;padding:0;display:inline"></div> 

    <div class="field"> 
     <label for="input_user_id">User ID</label> 
     <input class="form-control" id="input_user_id" name="input_user_id" type="text" placeholder="" value="KING0002" readonly> 
    </div> 

    <div class="field"> 
     <label for="input_name">Name</label> 
     <input class="form-control" id="input_name" name="input_name" type="text" placeholder="Name"> 
    </div> 

    <div class="field"> 
     <label for="input_password">Password</label> 
     <input class="form-control" id="input_password" name="input_password" type="password" placeholder="Password"> 
    </div> 

    <div class="field"> 
     <label for="credit">Credit </label> 
     <input class="form-control" id="credit" name="credit_limit" type="text" placeholder="Credit"> 
    </div> 

    <div class="field"> 
     <div class="form-group"> 
      <label for="create_member">Can Create Member</label> 
      <input type="radio" name="create_member" value="no" checked>No &nbsp;&nbsp; 
      <input type="radio" name="create_member" value="yes">Yes 
     </div> 
    </div> 
</form> 

我使用Twitter的引导我的文本框,表格控件类这段代码中,我试图添加单选按钮

Can Create Member: yes [] no [] 

但是输出结果显示yes和no在彼此之上。

如何修改我有一个适当的直列单选按钮,走线大约相同文本框,无论屏幕分辨率(无论是手机或台式机)

+0

也许这将有助于排除radio输入: http://stackoverflow.com/questions/14857909/lining-up-labels-with-radio-buttons- in-bootstrap – tetram 2014-08-28 18:03:29

回答

1

那是因为你给了50%的宽度到所有input元素。只需使用not像波纹管

.field input:not([type="radio"]) { 
    width: 50%; 
    margin: 0px; 
    } 

DEMO

+0

谢谢它的工作!我将在7分钟内接受答复(由于限制像我这样的新成员) – 2014-08-28 18:07:44