0

I am having iframe of 250 X 250, in which there is an image of 472 X 107.

Have look at snippet.

<iframe src="https://i.imgur.com/NYLlgwU.png" width="250px" height="250px"></iframe>

Now I want to show full image in the iframe, without scrolling.

Note 1: Size of Iframe should remain same i.e 250 X 250.

Note 2: Size of an image can change.

Note 3: It is not necessary it will be always an image. It can be pdf or text file too.

Babalu Pandey
  • 58
  • 1
  • 1
  • 14

1 Answers1

-1

You can add a scrolling="no" attribute to the iframe and tweak it using css a little.

iframe {
  max-width: 100%;
  overflow: hidden;
  border: none;
  margin: auto;
}
<iframe src="https://i.imgur.com/NYLlgwU.png" class="img-responsive" scrolling="no" width="250" height="250"></iframe>

See Codepen too

Samuel Asor
  • 480
  • 8
  • 25