2

I have a blog hosted by Blogger with a custom template: http://www.drugchannels.net/

Images uploaded to the blog are hosted at X.bp.blogspot.com (where X is a number). Examples:

https://1.bp.blogspot.com/-Jwy2VQYRIEA/WqmwvsA07WI/AAAAAAAATA4/jWVcEts1h1Y4IXM0hD0njUhSmQ2AZPnxQCLcBGAs/s1600/Specialty_vs_Retail-2014_vs_2017.png

https://4.bp.blogspot.com/-O4S9ps4u67k/Wk0yhTEuV-I/AAAAAAAASUE/5tPedr-p7_4kedNYU4RY711l6K3maokiQCLcBGAs/s1600/DCI-Copay_Accumulator-03Jan2018-CORRECTED.png

I want to have a white background when the image is clicked. (The images look fine on the site itself. This is not a problem with the blog's background, which is set to be solid white.)

Using the Inspect option in Chrome, I see the following information

The body formatting (background: #0e0e0e;) does NOT appear anywhere on my blog or in my template.

How can I fix?

Thank you!

P.S. I have 10 years of legacy posts with images, so I need a global solution that changes the background to white for all images posted to the blog.

  • If you want to change the actual images [here](https://stackoverflow.com/questions/27318549/replacing-transparent-background-with-white-color-in-png-images/27318979?s=14|33.0335#27318979) is a simple solution. – TaW Apr 06 '18 at 14:50

2 Answers2

0

Wrap the image in a div and set the background color of that div with css. That should work

.divclass:active { background:#FFFFFF }

If you are opening the images in a new tab or window then your only option is changing the background of the images yourself with a photo editor. If you're just trying to give the user a full size view of an image when they click it you could use javascript/jquery and have a full size div with a background and an image pop up in full screen without sending them to the linked image. Theres probably quite a few jquery plugins that will do this with minimal coding knowledge, just google it.

Riley Bell
  • 407
  • 4
  • 10
0

Thanks, Riley.

I can't go back and edit hundreds of images, so the photo editor option won't work.

But based on your suggestion, I used the following solution: 1) Enabled "Showcase Images with Lightbox" on blogger 2) Added CSS from this page (http://www.howbloggerz.com/2016/05/how-to-customize-blogger-lightbox.html) with no background image and background color set ot white (#ffffff).

Downside is that charts/images now pop up on same page rather than opening in a new tab.

Thank you!