【问题标题】:How can I remove the bottom border with CSS?如何使用 CSS 删除底部边框?
【发布时间】:2022-01-24 06:43:01
【问题描述】:

我正在使用引导程序,并且我已经将手风琴调整到了一张桌子上,它工作得很好,除了“切换打开”时的图标显示一个我想删除的边框底部。这可能是某处继承的东西,但我无法弄清楚。

问题:

折叠后它可以正常工作:

这是表格代码:

<!-- language: lang-css -->

    .accordion-line-button {
      padding: 0;
      width: auto;
      border: none;
    }
<!-- language: lang-html -->

    <table class="accordion" id="accordionExample">
      <tr class="accordion-item">
        <td class="accordion-header" id="heading1">
          <button class="accordion-button accordion-line-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse1" aria-expanded="true" aria-controls="collapse1"></button>
        </td>
        <td class="accord">
          Question
        </td>
      </tr>
      <tr>
        <td colspan="2" class="accordion-collapse collapse" id="collapse1" aria-labelledby="heading1" data-bs-parent="#accordionExample">
          <div class="accordion-body">Answer
          </div>
        </td>
      </tr>
    </table>

这里是bin 的链接。我正在使用我包含的模板,这是问题所在,有些东西正在继承,我无法弄清楚。

感谢您的帮助

【问题讨论】:

  • 我已将您发布的 HTML 和 CSS 转换为 Stack Snippet,但显然它需要添加更多代码 - 但只需要“minimal reproducible example”代码才能重现你描述的问题。请edit您的问题,并更新代码段。
  • 你不认为这只是图像的边界吗?或者您需要使用 css 更新图像的大小?
  • @DavidThomas 感谢您的编辑,我已经包含了复制问题的 bin 的链接。
  • @demo 没有图片,它是一个位于:after &lt;button&gt; 的图标,但感谢您的建议

标签: css bootstrap-4 accordion


【解决方案1】:

它不是边框属性,而是设置在按钮上的 box-shadow。请使用以下代码。

.accordion-line-button {
  box-shadow: none !important;
}

【讨论】:

  • 它有效,谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-02-25
  • 1970-01-01
  • 2014-10-29
  • 2023-03-26
  • 2018-06-13
  • 1970-01-01
相关资源
最近更新 更多