cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the background colour fornimage container

SOLVED

How to change the background colour fornimage container

Hi

I am using _theme.less file to do the changes and almost all the changes I have donen so far works  except the below code. The versin I am using is Magento 2.0.4.

Trying to change the background colour of image container as below. Default colour is white but wanted to change this to match with my page background, whic is #dadad0. Please help

 

 

.product-image-container{
          margin: 0 auto;
          background-color: #dadad0;     //background: #dadad0;//@theme-color-background;
        }

Tags (1)
3 REPLIES

Re: How to change the background colour fornimage container

Magento 2 adds white stripes while resizing a product image for a frontend product list (and my fix): https://mage2.pro/t/857

Re: How to change the background colour fornimage container

Hi

I tested your solution and it works as expected. Thank you very much. I really appriciate if someone can guide me how to overide this in my theme (which is copy of LUMA theme).

 

vendor/magento/framework/View/Design/Theme/Image.php

 

and in vendor/magento/module-catalog/Model/Product/Image.php

 

Re: How to change the background colour fornimage container

For those who dont want to edit the code to get ride of either side of white stripe of the image.

the images size ratio should be 1:1.5