Sourabh Agrawal
Sourabh Agrawal

Reputation: 856

How I can change the md-select text color?

I am using angular material in my website and I want to change the md-select color on focus. Can someone please help me with the classes I need to use to change its color?

I tried something like this

md-select {
  color: blue;
}

Also I want to change its placeholder color.

Upvotes: 3

Views: 7360

Answers (2)

Daniel Srp
Daniel Srp

Reputation: 383

My problem was that I wanted to change the color of the label that goes up when an element is selected. I solved it by using the following css.

md-input-container label { color: #000000!important; }

Upvotes: 0

Richard Hamilton
Richard Hamilton

Reputation: 26444

How can I change the md-checkbox-text color

Like this

<md-checkbox class="green">
   Green Checkbox
</md-checkbox>

md-checkbox.md-checked.green .md-icon {
 background-color: rgba(0, 255, 0, 0.87);
}

http://plnkr.co/edit/qc2tdr0VqCtbnpc0O4Y2?p=preview

As for ng-select, it turns out if you inspect the DOM, the placeholder attribute is a span element. To select it, you should use the CSS descendant selector

.md-select span {
    color: blue;
}

Source

https://material.angularjs.org/0.11.2/#/CSS/checkbox

Upvotes: 4

Related Questions