Change the background color of products( not the whole page)

Solved
A87
New Member
3 0 0

Hey there, 

 

I would like to change the background color of products in the product page. I have a lot of products and would like to do it in bulk, for example if theres a code I should type in the theme or something. I would appreciate it if anyone can help. 

0 Likes
Jasoliya
Shopify Expert
4295 569 1071

Add this:

{% if template contains 'product' %}
<style>
    .body{background-color: gray;}
</style>
{% endif %}
Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
A87
New Member
3 0 0

I did, nothing happened, I went through the previous steps you provided aswell, but nothing changed. 

Can you provide a specific and precise explanation please? 

0 Likes
Jasoliya
Shopify Expert
4295 569 1071

Sorry it was my mistack try this

Add this code in theme.liquid just before </body>

{% if template contains 'product' %}
<style>
    body{background-color: gray;}
</style>
{% endif %}
Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
A87
New Member
3 0 0

Hello there, 

 

Tried it , the whole page turned to grey except for the product image itself. I kind of want the opposite. I want the image background to turn to grey and not the way around

 

0 Likes
Jasoliya
Shopify Expert
4295 569 1071

Then you can replace  your image selector with 'your_image_selector'.

{% if template contains 'product' %}
<style>
    your_image_selector{background-color: gray;}
</style>
{% endif %}

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
fashionnably
New Member
1 0 0

I am looking to do the same thing. The code is not working. I would like all my photo images to have a light gray background.

0 Likes
thenonis
New Member
3 0 0

This did not work for me.. I tried what you provided and 

#shopify-section-collection .grid__item {background: #ffffff;}

My site is https://malia-kai-boutique.myshopify.com/

0 Likes
Jasoliya
Shopify Expert
4295 569 1071

If you want to change whole product background color then use this:

add this code in layout/theme.liquid

{% if template contains 'product' %}
<style>
    .body{background-color: gray;}
</style>
{% endif %}
Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
thenonis
New Member
3 0 0

I tried that. 

{% if template contains 'product' %}
<style>
.body{background-color: white;}
</style>
{% endif %}

I am trying to remove the color behind the images.. 

0 Likes