【问题标题】:Center RadioButtonList inside a panel在面板内居中 RadioButtonList
【发布时间】:2012-02-12 21:22:54
【问题描述】:

我似乎无法将 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>

任何帮助将不胜感激。

【问题讨论】:

    标签: asp.net center radiobuttonlist listitem


    【解决方案1】:

    在我看来,使用 div 而不是面板。但就像在面板中一样,您也可以尝试给予

    style="margin:auto;"
    

    【讨论】:

      【解决方案2】:

      只需将此标签放在您的单选按钮列表控件中: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>
      

      【讨论】:

        【解决方案3】:

        我打赌你需要编辑面板引用的 style8 并添加 tex-align: center;

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-01-24
          • 1970-01-01
          • 2010-10-09
          • 1970-01-01
          • 1970-01-01
          • 2012-02-02
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多