【问题标题】:Radio Button List Layout ASP .Net [closed]单选按钮列表布局 ASP .Net [关闭]
【发布时间】:2011-10-14 13:19:17
【问题描述】:

我无法为单选按钮列表实现所需的布局。我希望输出如下图所示。

这是我想要实现的目标的链接:

http://skitch.com/hiraldesai/fcfn9/radio-button-layout

这是我试图实现上述目标的代码,但我无法以编程方式获取单选按钮上方的文本。这是CSS的东西吗?我尝试过很多不同的RepeatLayout、RepeatDirection、RepeatColumns、TextAlign等组合。

AnswerRadioButtons.RepeatLayout = RepeatLayout.Table
AnswerRadioButtons.RepeatDirection = RepeatDirection.Horizontal                            

感谢您的建议。

【问题讨论】:

  • 问题中的图像现在已损坏,但答案仍然有用

标签: asp.net css radiobuttonlist


【解决方案1】:

我能够通过这个测试做到这一点。

<asp:RadioButtonList ID="rbl" runat="server" RepeatDirection="Horizontal" 
        RepeatLayout="Table" CssClass="RBL" TextAlign="Left">
    <asp:ListItem Text="radio button 1" />
    <asp:ListItem Text="radio button 1" />
    <asp:ListItem Text="radio button 1" />
</asp:RadioButtonList>

有了这个css

.RBL label
{
    display: block;
}

.RBL td
{
    text-align: center;
    width: 20px;
}

【讨论】:

  • 和垂直对齐:底部;对于 .RBL td 样式
猜你喜欢
  • 2011-04-08
  • 1970-01-01
  • 2016-11-17
  • 2020-12-23
  • 2018-01-23
  • 2013-09-04
  • 1970-01-01
  • 2018-09-26
  • 2015-06-06
相关资源
最近更新 更多