# Gradient background on buttons

**URL:** <https://forum.inductiveautomation.com/t/gradient-background-on-buttons/29106>\
**Category:** Ignition\
**Created:** [October 15, 2019, 9:42pm UTC](https://forum.inductiveautomation.com/t/gradient-background-on-buttons/29106 "2019-10-15T21:42:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian.zanotto](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sebastian.zanotto](https://forum.inductiveautomation.com/u/sebastian.zanotto)\
**Post date:** [October 15, 2019, 9:42pm UTC](https://forum.inductiveautomation.com/t/gradient-background-on-buttons/29106/1 "2019-10-15T21:42:56Z")

</div>

Hello, Is it possible to have a gradient background on a button.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 15, 2019, 10:51pm UTC](https://forum.inductiveautomation.com/t/gradient-background-on-buttons/29106/2 "2019-10-15T22:51:23Z")

</div>

That might depend on whether you’re using the Vision or Perspective module. Are you using Vision or are you using Perspective?

I want to say that gradients are not a possibility in Vision (but if someone wants to correct me, feel free).

Perspective gradients are easy:  
Set `Button.props.style.backgroundImage` to `linear-gradient(to right, yellow , green)`.  
 ![15%20PM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/19b1a91d07f0ec84f2af1f5b50bf76de4015dfaf.png)

To do a left-to-right gradient.

For a more diagonal gradient, use something like `linear-gradient(to bottom right, red , blue)`.

![39%20PM](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4300e926f9869da9269592838a013451c26733dd.png)

This page has some more examples: [CSS Gradients](https://www.w3schools.com/css/css3_gradients.asp).

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [October 15, 2019, 11:05pm UTC](https://forum.inductiveautomation.com/t/gradient-background-on-buttons/29106/3 "2019-10-15T23:05:55Z")

</div>

In Vision, you can put gradients on buttons if you make your own buttons (preferably a template) using a rectangle or other shape and scripting. I don’t use the built-in buttons, but I believe your only option on them (aside from what you may or may not be able to do digging down into the underlying Java) is the background 3D option which gives them a bit of gradient shading to make them look 3D.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 11, 2020, 11:12pm UTC](https://forum.inductiveautomation.com/t/gradient-background-on-buttons/29106/4 "2020-11-11T23:12:50Z")

</div>

Split this topic on November 11, 2020, 11:12pm UTC

2 posts were split to a new topic: [CSS Gradient in Perspective Style not working](https://forum.inductiveautomation.com/t/css-gradient-in-perspective-style-not-working/40565)
