Aaron
Aaron

Reputation: 4480

Color for first option in select will not change.

<select class="form-control" id="widgets">
            <option class="text-muted" style="color: grey;">Choose an option</option>
</select>

I have one option in my select and I want to change the color of the text to grey. I have tried Bootstrap text_muted or css color:grey. Neither work. What am I doing wrong?

Upvotes: 0

Views: 802

Answers (2)

Hello it seems not onlu bootstap adjusting color for but also default browser applies its style. Therefore you may act 2 ways: strict selector pointing e.g.: select>option.text-muted{color:red}.And the second one is to remove the double assigning of the color in bootstrap and clear browser cache after each modification of your code . It saves a lot of time. Color adjusted: https://jsfiddle.net/0p2dk5ee/.

Upvotes: 0

Kartik Prasad
Kartik Prasad

Reputation: 740

Looks fine to me, maybe you aren't noticing it because of the highlight on the single option see this change:

<select class="form-control" id="widgets">
    <option class="text-muted" style="color: white;">Choose an option</option>
    <option class="text-muted" style="color: grey;">Choose an option</option>
</select>

Upvotes: 1

Related Questions