# Adding CSS Gradient Background from gradient generator.

**URL:** <https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654>\
**Category:** Store Design\
**Created:** [May 24, 2019, 4:56am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654 "2019-05-24T04:56:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerius](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Gerius](https://community.shopify.com/u/Gerius)\
**Post date:** [May 24, 2019, 4:56am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/1 "2019-05-24T04:56:17Z")

</div>

I would like to add a CSS gradient background generated from a website like this → [https://mycolor.space/gradient3](https://mycolor.space/gradient3) to specific pages such as the home & product pages on the website and be able to change and edit them to different colors at will. I would also like to change the colors of certain elements, such as Add to Cart button & the search bar background to the same gradient background if at all possible.

Does anyone know how to do either of these things?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [May 24, 2019, 6:05am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/2 "2019-05-24T06:05:56Z")

</div>

Hi,

You can change background color of home and product page by following:

Add this in **theme.liquid**

```auto
{% if template contains 'index' or template contains 'product' %}
<style>
  body{background-image: linear-gradient(to right top, #d16ba5, #c777b9, #ba83ca, #aa8fd8, #9a9ae1, #8aa7ec, #79b3f4, #69bff8, #52cffe, #41dfff, #46eefa, #5ffbf1);}
</style>
{% endif %}

```

**You can change change color like this for search and add to cart button by adding css in theme.scss**

Let me know if you need help.

---

<div class="post-metadata">

**Author:** ![Gerius](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Gerius](https://community.shopify.com/u/Gerius)\
**Post date:** [May 24, 2019, 6:08am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/3 "2019-05-24T06:08:38Z")

</div>

Where exactly in theme.liquid do I add that code?

Edit: I’m also using the Venture theme, which has both “theme.liquid” files as well as “theme.scss.liquid” files. Should this code be added into the theme.liquid file that you first mentioned or the theme.scss file.

Thanks for your reply by the way 🙂

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [May 24, 2019, 6:15am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/4 "2019-05-24T06:15:56Z")

</div>

Add this code in **theme.liquid**

```auto
{% if template contains 'index' or template contains 'product' %}
<style> body{background-image: linear-gradient(to right top, #d16ba5, #c777b9, #ba83ca, #aa8fd8, #9a9ae1, #8aa7ec, #79b3f4, #69bff8, #52cffe, #41dfff, #46eefa, #5ffbf1);}
</style>
{% endif %}

```

This code is for background color changes.

Send me store url so i can check if any problem

---

<div class="post-metadata">

**Author:** ![Gerius](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Gerius](https://community.shopify.com/u/Gerius)\
**Post date:** [May 24, 2019, 6:26am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/5 "2019-05-24T06:26:40Z")

</div>

I’m not exactly sure where to add the code. Should it be added directly under the tag?

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [May 24, 2019, 6:33am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/6 "2019-05-24T06:33:28Z")

</div>

You can add before tag on file.

---

<div class="post-metadata">

**Author:** ![Gerius](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Gerius](https://community.shopify.com/u/Gerius)\
**Post date:** [May 24, 2019, 6:44am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/7 "2019-05-24T06:44:59Z")

</div>

Added the code, saved it, and refreshed my theme but the changes are not showing and the background is still the same. I added you on Skype. Are you available to do a screen share over Skype so that I can show you what I’m doing?

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [May 24, 2019, 6:59am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/8 "2019-05-24T06:59:37Z")

</div>

Sure, Skype (jasoliya.brijesh).

Also send me your store URL so i can check

---

<div class="post-metadata">

**Author:** ![Gerius](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Gerius](https://community.shopify.com/u/Gerius)\
**Post date:** [May 24, 2019, 7:32am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/9 "2019-05-24T07:32:21Z")

</div>

Added you. Did you get my message?

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [May 24, 2019, 7:34am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/10 "2019-05-24T07:34:00Z")

</div>

No, send me your id

---

<div class="post-metadata">

**Author:** ![Gerius](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Gerius](https://community.shopify.com/u/Gerius)\
**Post date:** [May 24, 2019, 7:36am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/11 "2019-05-24T07:36:08Z")

</div>

GTory

---

<div class="post-metadata">

**Author:** ![KYG](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@KYG](https://community.shopify.com/u/KYG)\
**Post date:** [November 26, 2019, 4:44pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/12 "2019-11-26T16:44:28Z")

</div>

Hello there what if I want to make a gradient color for background of the main menu? Could you please help me with the code?

> [@Jasoliya](#):
>
> Hi,
> 
> You can change background color of home and product page by following:
> 
> Add this in **theme.liquid**
> 
> ```auto
> {% if template contains 'index' or template contains 'product' %}
> 
> {% endif %}
> 
> ```
> 
> **You can change change color like this for search and add to cart button by adding css in theme.scss**
> 
> Let me know if you need help.

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [November 27, 2019, 4:59am UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/13 "2019-11-27T04:59:10Z")

</div>

Hi @KYG

You can add gradient color in background by this css:

```auto
#your_menu_id{ background-image: linear-gradient(red, yellow, green);}

```

You have to change id base on your menu code. you can also change color

---

<div class="post-metadata">

**Author:** ![KYG](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@KYG](https://community.shopify.com/u/KYG)\
**Post date:** [November 27, 2019, 1:51pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/14 "2019-11-27T13:51:40Z")

</div>

How can I add bottom-border 1 px to the navigation menu? My header and body  
are white and when I scroll down I can’t distinguish them?

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [November 27, 2019, 1:55pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/15 "2019-11-27T13:55:42Z")

</div>

Send your store url

---

<div class="post-metadata">

**Author:** ![AlohaAmerica20](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@AlohaAmerica20](https://community.shopify.com/u/AlohaAmerica20)\
**Post date:** [November 26, 2020, 2:25pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/16 "2020-11-26T14:25:47Z")

</div>

I followed the directions and I went from a dull grey background to a beautiful Gradient!!! Thank you so much Jasoliya! You are very much appreciated!

Let me know what you think of it!

LINK BELOW

[www.alohaamerica.us](http://www.alohaamerica.us)

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [November 26, 2020, 2:29pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/17 "2020-11-26T14:29:40Z")

</div>

Its looking good now what do you want to do?

---

<div class="post-metadata">

**Author:** ![AlohaAmerica20](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@AlohaAmerica20](https://community.shopify.com/u/AlohaAmerica20)\
**Post date:** [November 26, 2020, 2:32pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/18 "2020-11-26T14:32:13Z")

</div>

I would like to test some different color gradients I think!

Would I make those changes via the HTML theme.liquid code? or in the css.liquid file?

---

<div class="post-metadata">

**Author:** ![Jasoliya](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/jasoliya/32/282026_2.png) [@Jasoliya](https://community.shopify.com/u/Jasoliya)\
**Post date:** [November 26, 2020, 2:40pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/19 "2020-11-26T14:40:33Z")

</div>

yes you can chaneg css here that only work for home page:

```css
{% if template contains 'index' or template contains 'product' %}

{% endif %}

```

You can get color from [this site](https://uigradients.com/#Mystic)

---

<div class="post-metadata">

**Author:** ![AlohaAmerica20](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@AlohaAmerica20](https://community.shopify.com/u/AlohaAmerica20)\
**Post date:** [November 26, 2020, 2:47pm UTC](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654/20 "2020-11-26T14:47:15Z")

</div>

Thank You, You are very helpful! Have A Wonderful Day & Happy Thanksgiving!

[Next page](https://community.shopify.com/t/adding-css-gradient-background-from-gradient-generator/3654.md?page=2)
