c#.net 中如何设置radiobuttonlist的listitem的宽度啊

解决方案 »

  1.   

      <style>
            .myrbl td
           {
            width:200px;
           border:solid 1px red; 
           } 
           </style>
           <asp:RadioButtonList ID="r1"  CssClass="myrbl"  runat="server">
            <asp:ListItem Text="AAAAAA" Value="1"></asp:ListItem>
           <asp:ListItem Text="BBBBBBB" Value="1"></asp:ListItem> 
           </asp:RadioButtonList>
      

  2.   

    <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                <asp:ListItem Value="男"></asp:ListItem>
                 <asp:ListItem Value="女"></asp:ListItem>
                </asp:RadioButtonList>
    设置RadioButtonList1样式就可
    <style>
            .ListControlCSS {}{ list-style:none; margin:0px; width: 400px; background-color: #CCC; }
            .ListControlCSS INPUT {}{ background-color: #CCC; }
            .ListControlCSS li{}{ float:left; width:100px; line-height:30px;}
        </style>
    CssClass="ListControlCSS">
    或自定义RadioButtonList