# Perspective menu tree - style rule elementState with background-image

**URL:** <https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 15, 2021, 7:20pm UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016 "2021-09-15T19:20:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 15, 2021, 7:20pm UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016/1 "2021-09-15T19:20:32Z")

</div>

Ignition 8.1.8  
In a menu Tree, I have some items with background-image like :

```auto
linear-gradient(90deg,var(--byes-bg-menu) 0% 90%, var(--byes-bg-menu) 90.00% 92.00%, var(--byes-defautCom) 92.00% 94.00%, var(--byes-bg-menu) 94.00% 96.00%, var(--byes-bg-menu) 96.00% 98.00%, var(--byes-bg-menu) 98.00% 100.00%)

```

and an itemStyle with a style rule for button hover:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/cc71289f99544825b53f43289015150463a6f170.png)

if the background-image is empty, hover style is well applied, but if the background-image is not empty hover style is not applied (button has not the orange color)

---

<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 16, 2021, 7:00am UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016/2 "2021-09-16T07:00:44Z")

</div>

is linear-gradient a valid background-image?  
could you show me the properties of the tree?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 16, 2021, 7:02am UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016/3 "2021-09-16T07:02:34Z")

</div>

background-image:

```auto
linear-gradient(90deg, var(--byes-bg-menu) 0% 90%, var(--byes-bg-menu) 90.00% 92.00%, var(--byes-defautCom) 92.00% 94.00%, var(--byes-bg-menu) 94.00% 96.00%, var(--byes-bg-menu) 96.00% 98.00%, var(--byes-bg-menu) 98.00% 100.00%)

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/372a990860e95fad97448a1a1d0990dad6d404bb.png)

---

<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 16, 2021, 7:03am UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016/4 "2021-09-16T07:03:26Z")

</div>

ah yes i see place !important after none

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/eccbac2effdebae272414bd35735f9f5ea13193b.png)

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 16, 2021, 7:07am UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016/5 "2021-09-16T07:07:30Z")

</div>

Yes it works, thanks a lot !

---

<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 16, 2021, 7:08am UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016/6 "2021-09-16T07:08:12Z")

</div>

you could also place the lineargradient into the basestyle instead of as a property, if they will be all the same across the buttons

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 16, 2021, 7:20am UTC](https://forum.inductiveautomation.com/t/perspective-menu-tree-style-rule-elementstate-with-background-image/51016/7 "2021-09-16T07:20:42Z")

</div>

The style is different (and updated by script) for each button, so we can’t.
