# Styling background color of ion-option

**URL:** <https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540>\
**Category:** ionic-v3\
**Created:** [May 31, 2016, 5:59pm UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540 "2016-05-31T17:59:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![theyouishere](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@theyouishere](https://forum.ionicframework.com/u/theyouishere)\
**Post date:** [May 31, 2016, 5:59pm UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/1 "2016-05-31T17:59:28Z")

</div>

Hey there,

I have an ion-select with some ion-options and i’m trying to set some background color wich depends on the value of the ion-option. So the background of each ion-option might be different (red, blue, orange…).

I tried to add a class to the ion-option, it just doesnt show in the HTML so i can’t style it. So if any of you guys can add a class to that sort of element, let me know !!

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [May 31, 2016, 6:41pm UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/2 "2016-05-31T18:41:51Z")

</div>

[The Select docs](http://ionicframework.com/docs/v2/api/components/select/Select/) suggest that you can use [an ActionSheet](http://ionicframework.com/docs/v2/api/components/action-sheet/ActionSheet/), which has a `cssClass` attribute for its buttons. I haven’t tried it, but might be worth looking into.

---

<div class="post-metadata">

**Author:** ![theyouishere](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@theyouishere](https://forum.ionicframework.com/u/theyouishere)\
**Post date:** [May 31, 2016, 6:45pm UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/3 "2016-05-31T18:45:49Z")

</div>

an ActionSheet looks like something that should be use to make an action. Like the example: Share, edit, etc…

But what i’m looking for is to change the background color of my select because i’m still filling up a form.

Thanks for your answer ! 🙂

---

<div class="post-metadata">

**Author:** ![xiejiabao](https://avatars.discourse-cdn.com/v4/letter/x/ea5d25/32.png) [@xiejiabao](https://forum.ionicframework.com/u/xiejiabao)\
**Post date:** [February 24, 2017, 10:01am UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/4 "2017-02-24T10:01:16Z")

</div>

Hi, I got the same question for that. Did you find out any solution?

---

<div class="post-metadata">

**Author:** ![moere](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@moere](https://forum.ionicframework.com/u/moere)\
**Post date:** [May 16, 2017, 2:23pm UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/5 "2017-05-16T14:23:30Z")

</div>

Same question here.  
[ngStyle], [ngClass], [class], [style] all not working with ion-option

---

<div class="post-metadata">

**Author:** ![KishuPro](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KishuPro](https://forum.ionicframework.com/u/KishuPro)\
**Post date:** [May 17, 2017, 3:04am UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/6 "2017-05-17T03:04:24Z")

</div>

If those don’t work, then I’d think you should be able to target the relevant elements with `css` selectors.

---

<div class="post-metadata">

**Author:** ![moere](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@moere](https://forum.ionicframework.com/u/moere)\
**Post date:** [May 17, 2017, 6:21am UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/7 "2017-05-17T06:21:19Z")

</div>

That is not possible in my case. I have to color the ion-options by  
specific value which I get by looping a field on the ion-option.

Well it looks like that I have to create my own directive.

Am 17.05.2017 5:14 vorm. schrieb “Kishore” \<[ionicframework@discoursemail.com](mailto:ionicframework@discoursemail.com)

---

<div class="post-metadata">

**Author:** ![KishuPro](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KishuPro](https://forum.ionicframework.com/u/KishuPro)\
**Post date:** [May 17, 2017, 7:27am UTC](https://forum.ionicframework.com/t/styling-background-color-of-ion-option/53540/8 "2017-05-17T07:27:29Z")

</div>

I don’t know what your particular situation is, but I was playing around with this and could create `ion-options` with each of them having their own specific background color. It might help you to know that I used the fact that an `ion-select` component implements the `alert interface` by default and I could pass it `options` with a custom class to tag it. Then I could easily target that select and the options it has with some advanced css selectors.

I believe there is still a better way to do it, for example we could give each `ion-option` its own id so that we don’t have to do much in selecting them with css. But for now this is enough playing around for me 😃
