Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a border to md-select selectbox of angular material?

I want to add a 1px border to the select box ( md-select ) of angular material.

How do I do it using CSS?

like image 515
Sabyasachi Avatar asked Jul 14 '16 07:07

Sabyasachi


1 Answers

In latest angular versions, md-select is renamed as mat-select and to add border to mat-select, you can use mat-form-field in your html file as follows:

<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>

Here appearance="outline", will add border to the select box.

like image 95
Aditya Kumar Avatar answered Oct 14 '22 05:10

Aditya Kumar