如何在角材料的md-select selectbox中添加边框?

Sab*_*chi 5 angularjs angular-material

我想向角形材料的选择框(md-select)添加一个1px边框。

如何使用CSS?

Adi*_*mar 6

在最新的 angular 版本中,md-select 被重命名为 mat-select 并为 mat-select 添加边框,您可以在 html 文件中使用 mat-form-field 如下:

<mat-form-field appearance="outline">
    <mat-select placeholder="Select your option">
        <mat-option *ngFor="let option of options" [value]="option">
           {{option}}
        </mat-option>
    </mat-select>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)

这里外观=“轮廓”,将为选择框添加边框。


Sab*_*chi 2

我就是这样做的。十分简单!

为 md-select 标签添加 CSS

md-select {
               background-color: white;   
               color: black;
               border : 1px solid #666666;

}
Run Code Online (Sandbox Code Playgroud)