【问题标题】:Asp radio button list each three radio buttons in one row bootstrabAsp 单选按钮在一行引导程序中列出每三个单选按钮
【发布时间】:2017-08-27 03:42:22
【问题描述】:

如何从 asp:RadioButtonList rblbase 中获取每 3 个单选按钮,如下面的代码。

<div class="row">
<div class="col-sm-4">
    Radio1
</div>
<div class="col-sm-4">
    Radio2
</div>

<div class="col-sm-4">
    Radio3
</div>

它下面的行应该是

<div class="row">
<div class="col-sm-4">
    Radio3
</div>
<div class="col-sm-4">
    Radio4
</div>

<div class="col-sm-4">
    Radio5
</div>

单选按钮列表

<asp:RadioButtonList ID="rblbase" runat="server"></asp:RadioButtonList>

【问题讨论】:

  • 设置RepeatDirection="Horizontal"

标签: html asp.net twitter-bootstrap css


【解决方案1】:

使用 RepeatDirection = Horizo​​ntal 并在 CSS 中设置 ma​​rgin-left,right。例如,

<asp:RadioButtonList ID="rblbase" runat="server" 
RepeatDirection="Horizontal" CssClass="myRadioBtn"></asp:RadioButtonList>

然后在你的css代码中,

.myRadioBtn input[type="radio"]
{
  margin-left: 15px;
  margin-right: 15px;
}

Orelse 你可以使用 CellPadding 和 CellSpacing,如下所示,

<asp:RadioButtonList ID="rblbase" runat="server" 
RepeatDirection="Horizontal" CellPadding="2" CellSpacing="2">
</asp:RadioButtonList> //change the values

希望对你有帮助:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-24
    • 2015-09-11
    • 1970-01-01
    • 2015-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-17
    相关资源
    最近更新 更多