将 RadioButtonList 置于面板内的中心

发布于 2024-12-28 02:06:23 字数 767 浏览 3 评论 0原文

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

任何帮助将不胜感激。

I cannot seem to be able to center my RadioButtonList inside a panel. It always seems to e left justified. No matter what I try.

My current code is:

<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>

Any help would be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

软甜啾 2025-01-04 02:06:23

只需将此标记放入单选按钮列表控件中即可: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>

Just put this tag in your Radio Button List control: 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>
熊抱啵儿 2025-01-04 02:06:23

在我看来,使用 div 而不是 panel。但正如面板中所示,您也可以尝试给予

style="margin:auto;"

In my view use div instead of panel. But as in panel you can also try with giving

style="margin:auto;"
秋风の叶未落 2025-01-04 02:06:23

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

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

I bet you need to edit the style8 referenced by the panel and add tex-align: center;

<style>
  .style8
      {
        text-align:center;
      }
 </style>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文