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

Goodevening, I just can’t seem to find out how to change the background color behind my products. My products are with no background so it takes the background of the page. Now my homepage has a white background and I know how to change that and the rest that changes automatically aswell. I want to keep the background white as well on my products page but want to have the background of my products light grey. Is this possible? Thank you for all your time and help.

Hi @kaat86

You have to add your css i such condition like below:

Add this code in Layout->theme.liquid file just before

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

Note: Change your_section_selector to your section.

1 Like

Thank you so much for the fast response.

Im very new to this so the first part I could do, but I don’t know how to do the following:

Note: Change your_section_selector to your section.

How do I find out what the section is called ore should i not type it in stead of your_section_selector?

Thank you so much for the fast response.

Im very new to this so the first part I could do, but I don’t know how to do the following:

Note: Change your_section_selector to your section.

How do I find out what the section is called ore should i not type it in stead of your_section_selector

Send me store url and let me know on which section you want to change background color on product page?

Thank you so much, so here is the link and some examples of what I want it to look like. I want this for every collection so women,men, baby& kids and accessories all in the same lightgrey #e2e0e0 .

Thank you for your time!

https://ohlord.us/collections/man

https://ohlord.us/

Is this your store? then add this css in asset->theme.scss file at bottom:

#CollectionSection .grid-uniform .lazyload__image-wrapper{background: #e2e0e0;}
1 Like

Thank you so much it worked!! im very grateful for your help!

I have the same question. I tried both code edits shown in this post with no success. Any other things I should try? Using Debut theme.

I ended up Having one of the Experts help me and the codes did work for me
aswel. Maybe post the question again and I’m sure they will help you too!
Sorry I can not be of any more help. Good luck with your store!

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.

:slightly_smiling_face:

Add this:

{% if template contains 'product' %}

{% endif %}

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?

Sorry it was my mistack try this

Add this code in theme.liquid just before

{% if template contains 'product' %}

{% endif %}

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 :slightly_smiling_face:

Then you can replace your image selector with ‘your_image_selector’.

{% if template contains 'product' %}

{% endif %}

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.

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/

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

add this code in layout/theme.liquid

{% if template contains 'product' %}

{% endif %}

I tried that.

{% if template contains 'product' %}

{% endif %}

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