# Cannot apply a style class to an image inside a button in Perspective

**URL:** <https://forum.inductiveautomation.com/t/cannot-apply-a-style-class-to-an-image-inside-a-button-in-perspective/79205>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 15, 2023, 9:15am UTC](https://forum.inductiveautomation.com/t/cannot-apply-a-style-class-to-an-image-inside-a-button-in-perspective/79205 "2023-09-15T09:15:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewis.storey](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lewis.storey/32/15026_2.png) [@lewis.storey](https://forum.inductiveautomation.com/u/lewis.storey)\
**Post date:** [September 15, 2023, 9:15am UTC](https://forum.inductiveautomation.com/t/cannot-apply-a-style-class-to-an-image-inside-a-button-in-perspective/79205/1 "2023-09-15T09:15:56Z")

</div>

I have been making use of the image on the button component and my intention was to use an embedded svg with no fill information and have the colour set using a css filter. Rather than apply that style individually to each button I built a class in the advanced stylesheet as follows:

```auto
.psc-filter-icon-red-500 {
  filter: invert(26%) sepia(71%) saturate(5171%) hue-rotate(345deg) brightness(91%) contrast(105%);
}

```

The problem I have is that when adding this to the `image.style.classes` property on the button nothing happens. I had a dig around with the dev console in chrome and I can't see a `class` attribute on the `<img>` tag at all. A further dig in the perspective code looks like it might not be properly transferring the classes over as it does with the `textStyle` property.

Directly applying the filter style works fine as expected but the documentation does say 'You can also specify a style class.'

In the end I have created a work around by adding `> div > img` to the class and putting that on the button itself but I would rather not have classes built specifically for component.

Is this a bug or am I missing something?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [September 15, 2023, 11:57am UTC](https://forum.inductiveautomation.com/t/cannot-apply-a-style-class-to-an-image-inside-a-button-in-perspective/79205/2 "2023-09-15T11:57:52Z")

</div>

seems like a bug
