How to display PDF in popup when clicking link using html / css only?

0

On a certain page of a site, I have an image with a link pointing to a PDF file. As it is currently, when the user clicks on the image, the PDF file opens in another browser tab.

But I need to find a way that when the user clicks on the image, the PDF will be displayed in pop-up on the current page, preferably using html/css . The code currently looks like this:

<a href="images/CartaServicos/Assinatura-Externa.pdf" target="_blank"> 
    <img src="images/CartaServicos/AssinaturaExterna.PNG" alt="AssinaturaExterna"/>
</a>

If you can give birth, thank you.

    
asked by anonymous 31.07.2018 / 17:51

1 answer

0

Leandro, I believe the only solution is with Javascript. The link will open in a new window, and with Javascript you can set the size of this new window, thus generating a popup.

<a href="http://seulinkaqui.com" 
  target="popup" 
  onclick="window.open('http://seulinkaqui.com','popup','width=600,height=600'); return false;">
    
01.08.2018 / 04:08