在面板内居中 RadioButtonList

use*_*383 4 asp.net radiobuttonlist center listitem

我似乎无法将 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>
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感激。

Tap*_*ata 5

只需将此标签放在您的单选按钮列表控件中: align="center"

<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>
Run Code Online (Sandbox Code Playgroud)