在禁用垫选择角度时如何隐藏下划线

时间:2018-07-02 19:27:53

标签: angular list dropdown underline

在此页面https://material.angular.io/components/select/overview的“禁用选择或单个选项”中,禁用时的mat-select如下所示:

mat-select

所以我想隐藏该尖的下划线。

我尝试了这里找到的一些解决方案,但是没有一个对我有帮助。

2 个答案:

答案 0 :(得分:0)

这不是下划线,是背景图片。试试这个。

.mat-form-field-disabled .mat-form-field-underline {
            background-image: unset;
}

将其添加到style.css中,并检查angular.json是否在主题文件之前加载了style.css

答案 1 :(得分:-1)

将此CSS代码添加到您的组件中:

    <table id="detailTable">
      <thead><tr><th>ProductName</th><th>Qty</th><th>Price</th></tr></thead>
        <tbody>
        </tbody>
    </table>