2012-01-18 39 views
3

我似乎无法将我的RadioButtonList放置在面板中。它似乎总是左对齐。无论我尝试什么。面板内的RadioButtonList中心

我当前的代码是:

<asp:panel ID="Panel1" runat="server" CssClass="style8" Height="228px" 
    width="456px"> 
    <br /> 
     <p style ="text-align:center"> 
       <asp:Label ID+"Label2" runat="server" Text="Blah"> 
       </asp:Label> 
     </p> 
     <asp:RadioButtonList ID="AlertClients" runat="Server" TextAlign="Right" 
     style="list-style=center"> 
       <asp:ListItem> Option 1</asp:ListItem> 
      <asp:ListItem> Option 2</asp:ListItem> 
      <asp:ListItem> Option 3</asp:ListItem> 
     </asp:RadioButtonList> 
</asp:Panel> 

任何帮助将非常感激。

回答

4

只是把这个标签在你的单选按钮列表控件:ALIGN =“中心”

<asp:RadioButtonList ID="AlertClients" runat="Server" TextAlign="Right" Style="list-style=center" align="center"> 
<asp:ListItem> Option 1</asp:ListItem> 
<asp:ListItem> Option 2</asp:ListItem> 
<asp:ListItem> Option 3</asp:ListItem></asp:RadioButtonList> 
1

在我看来用div代替面板。但随着面板,您也可以尝试给

style="margin:auto;" 
0

我敢打赌,你需要编辑通过引用的美丽人生面板并添加tex-align:center;

<style> 
    .style8 
     { 
     text-align:center; 
     } 
</style>