2012-01-18 20 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>