Pedro Laia
Pedro Laia

Reputation: 69

Change background color in about:blank

I have a small image with a link. When the user clicks on that image, a new tab opens (about:blank) and just the image is showed and the user can click on the image to make it bigger (it's the default in any browser). What I wanted was to have the background in white, not black. Is it possible?

 <div class="portfolio-thumb">
     <img src="img/portfolio/2016/2016-01-Small.jpg" alt="" />
     <div class="view-icon">
       <a href="img/portfolio/2016/2016-01-Big.jpg" target="_blank"><span class="icon-focus"></span></a>
     </div>
 </div>

Upvotes: 4

Views: 1608

Answers (1)

Joeri
Joeri

Reputation: 646

Unfortunately you can not do that with regular css. You could try to get the user to download a plugin but that's all.

This is because all your server is sending is the image, no css, no html and no javascript. therefore you cannot control anything other than the image.

A possible solution to this could be to not direct the user to the image but to an image viewer, imageviewer.html?img=image.png or something, and display the image inside of a page.

I hope this is of any use and good luck.

sidenote: you can use this to retrive data from a url.

Upvotes: 1

Related Questions