2016-01-06 81 views
0

我无法将单选按钮列表与上面的标签左侧对齐。 这里是代码无法对齐单选按钮列表

<div style="border-radius: 10px;"> 
     <div style="margin-bottom: 10px"></div> 
     <asp:Panel ID="panel" runat="server"> 
      <div style="padding-left: 10px" > 
       <asp:Label ID="lbl" runat="server" Text="Select criteria" /> 
       <asp:RadioButtonList ID="radio" runat="server" AutoPostBack="True" OnSelectedIndexChanged="radio_SelectedIndexChanged" RepeatDirection="Horizontal" /> 
       <asp:Label ID="lbl1" runat="server" Text="Value"></asp:Label> 
       <br /> 
       <asp:TextBox ID="txt" runat="server"></asp:TextBox> 
       <asp:Label ID="ScoreMethodLabel" runat="server" Text="Score"></asp:Label> 
       <asp:DropDownList ID="dropscore" runat="server" />&nbsp; 
      </div> 

     </asp:Panel> 
     <br/> 
    </div> 

这里的输出我看到

enter image description here

你看到选项按钮不exaxctly下面的文字叫 “选择标准” 对准

+0

右键单击r adio按钮,*检查元素*(在chrome atleast上)并将鼠标悬停在检查器面板中的元素上 - 然后检查元素是否显示橙色/紫色着色,如果为真,则橙色表示边距,紫色表示边距填充。然后,您可以继续并重置您的CSS – SidOfc

+0

@SidneyLiebrand我看到橙色,但即使我添加了保证金,它不对齐 – Happy

+0

@SidneyLiebrand当我打开使用F12的HTML。然后它呈现为输入类型=无线电,当我添加保证金:0,那么它的作品。但不是当我直接添加财产保证金:0对asp:radiobuttonlist – Happy

回答

0

尝试margin:0

* { 
    margin: 0; 
    } 

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

does not make differenc – Happy

+0

https://jsfiddle.net/qyvv1922/1/ –

+0

我加入这样 Happy