【问题标题】:Gray square around disabled radio button禁用单选按钮周围的灰色方块
【发布时间】:2020-09-16 03:27:30
【问题描述】:

buttons on IE我使用引导程序在 ASP.NET 中创建了单选按钮。这些按钮应该被禁用,这在 chrome 中可以正常工作,但在 Internet Explorer 中,它会在按钮周围创建一个灰色方块。我已经能够通过使用 div 禁用标签包装输入标签来在 IE 上将其删除。但是,这在 chrome 中不起作用。所以我不能让一个工作而不搞乱另一个。我包含的代码是适用于 chrome 的代码。

input[disabled] {
    cursor: not-allowed;
    background-color: #cfcfcf;
}

input[type="radio"], input[type="checkbox"] {
    box-sizing: border-box;
    padding: 0;
}
<div class="form-check">
       <input disabled="disabled" checked="checked" class="form-check-input" id="Male" name="GenderSelection" type="radio" value="Y">
       </div>
        <label for="Male">Male</label>

]2

【问题讨论】:

  • 你好 UniJur 这似乎是一个 CSS 问题。您能否将您的 css 代码添加到您的问题中,以便我们更好地了解发生了什么。
  • 嗨,查尔斯,我添加了 CSS

标签: c# html css asp.net-mvc bootstrap-4


【解决方案1】:

问题在于css。

input[disabled] {background-color:#cfcfcf;}

删除它就可以了。

谢谢!

【讨论】:

  • 您好 nkahootxShawn,请参阅更新后的问题。谢谢
  • 既然我回答了最初的问题,您介意将其标记为正确吗?谢谢!
猜你喜欢
  • 2021-07-09
  • 1970-01-01
  • 2016-10-14
  • 2023-02-04
  • 2017-08-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多