【问题标题】:How to remove border of the asp.net radio button如何删除asp.net单选按钮的边框
【发布时间】:2016-10-26 20:14:33
【问题描述】:

我有一个如下所示的单选按钮,但我无法在 IE 中删除该单选按钮的边框。 Chrome 也是如此。

<fieldset id="fsdeSign">
            <table width="98%">
                <tr>
                    <td align="right" colspan="2">
                        <div id="divName" runat="server" visible="false">
                            <span>
                                <label class="required" runat="server" id="Label1" style="width: 90px">
                                    <span id="NameSpan" runat="server">*</span>Name</label></span>                           
                            <asp:TextBox ID="textName" runat="server" MaxLength="20"></asp:TextBox>
                        </div>
                    </td>

                    <td align="right">
                        <asp:Label ID="lblaccount" Style="display: none" runat="server" Width="155px"
                            Text="Would you like to use your account?"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:RadioButtonList ID="rblaccount" runat="server" Style="display: none;border-style:none;" RepeatDirection="Horizontal">
                            <asp:ListItem Value="Yes" Text="Yes" />
                            <asp:ListItem Value="No" Text="No" Selected="True" />
                        </asp:RadioButtonList>
                    </td>                    
                </tr>
            </table>
        </fieldset>

我使用了下面的 cssclass="Sign" 没有反映。我需要添加更多标签吗?

fieldset#fseSign  input.Sign
{
    border-style:none;
}

【问题讨论】:

    标签: html css asp.net


    【解决方案1】:

    尝试在&lt;asp: RadioButtonList&gt; 中添加BorderStyle="None"。您的代码应如下所示:

    <asp:RadioButtonList ID="rblaccount" runat="server" Style="display: none" RepeatDirection="Horizontal" BorderStyle="None">
        <asp:ListItem Value="Yes" Text="Yes" />
        <asp:ListItem Value="No" Text="No" Selected="True" />
    </asp:RadioButtonList>
    

    无论如何,试着看看这个类似的案例here。 如果它不起作用,您也可能必须通过以下方式编辑其css

    input[type="radio"] {
        border-style:none;
    }
    

    【讨论】:

    • 它不工作。我已经尝试了该链接中提到的所有选项。
    • 我已经尝试过该部分并且它正在工作。但我在多页中面临这个问题。所以我不能在每个页面中添加以下内容。这个有办法吗??
    • 所以这样说,你的意思是每个页面你使用不同的css,对吧?为每个页面导入一个特定的 file.css,以及一个通用的,然后您可以在其中输入我的答案,怎么样?
    【解决方案2】:

    试试这个 fieldset#fsdeSign 输入 {边框样式:无;}

    【讨论】:

    • 我试过了,但其他文本框:textName 正在失去边框
    • 也许你可以试试 textName 到solid的边框样式
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-01
    • 1970-01-01
    • 2016-07-24
    • 1970-01-01
    • 2021-09-24
    • 2017-10-12
    • 1970-01-01
    相关资源
    最近更新 更多