我正在使用 Material for Angular .我需要定义一个 md-select component在自定义组件中。事实上,我需要 md-select 没有类似于 solution 的下划线。对于 AngularJS。
根据生成的元素,我尝试如下定义 CSS 类,但它们不起作用。
我的.component.html
<span>My Component</span>
<md-select placeholder="My Select" floatPlaceholder="never">
<md-option *ngFor="let option of options"
[value]="option.value">{{option.viewValue}}</md-option>
</md-select>
我的.component.scss
.mat-select { /* This is working */
display: block;
width: 396px;
height: 34px;
background-color: $pale-gray-two;
padding: 11px 13px 14px !important;
font-size: 11px !important;
color: $greyish-brown-two !important;
}
.mat-select-trigger { /* This is not working */
.mat-select-underline {
display:none !important;
}
}
尝试:
/deep/ .mat-select-underline {
display: none;
}
demo
我是一名优秀的程序员,十分优秀!