将 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>
任何帮助将不胜感激。
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需将此标记放入单选按钮列表控件中即可:align=“center”
Just put this tag in your Radio Button List control: align="center"
在我看来,使用 div 而不是 panel。但正如面板中所示,您也可以尝试给予
In my view use div instead of panel. But as in panel you can also try with giving
我打赌您需要编辑面板引用的 style8 并添加 tex-align: center;
I bet you need to edit the style8 referenced by the panel and add tex-align: center;