Ways to Replace <Iframe> in HTML

Asked

Viewed 1,427 times

1

I have a code that doesn’t work on IE8 and I wanted to find a way to get it working with any other code. even if it’s jquery.

HTML:

<center><table border="0">
<tr border="0">
<td border="0">
<iframe class="TbRH" src="RH/RH.PDF"   ></iframe>
</td>
</tr>
</table></center>

CSS:

width:100%; height:1140px;
border:none;overflow-x:hidden;
overflow-Y:hidden;

http://jsfiddle.net/ojcfofb0/

  • Why doesn’t your code work? What happens? What should happen?

  • It does not show the PDF in IE8. That’s why I wanted to put a code that works in all Browser including IE8

  • Will the PDF always be the same? why not an image?

  • 1

    Sometimes it is necessary to change. and it is always easier to change through PDF.

  • <center> with <table>? you have ever thought to read about Webstandards and try bootstraps.

  • I thought to suggest you PDF.js, but it does not support IE8. I understand your frustration at having to support IE8. it should come with the "Install new versions automatically" option as default.

  • Only on some computers it’s only IE8. But that’s it

Show 2 more comments

3 answers

1

The table does absolutely nothing.

Remove it and set the size on itself iframe.

CSS is also unnecessary.

Remove everything and use just like this:

<iframe width="100%" height="1140" src="teste/teste.PDF"></iframe>

Note: Even in the latest version of Chrome, the script you posted doesn’t work. It’s not something specific to IE8.

1

Maybe it’s simpler than it looks, try it:

CSS

iframe {
  position:relative;
}
  • 1

    I’ve tried that and it still doesn’t work ..

  • has some script being locked in the log console ?

  • There’s nothing to be blocked I guess

1

If I understand your problem correctly the solution is to put display:block and instead of overflow-x and overflow-y with the value hidden use only overflow, follows the code:

.TbRH {
  width: 100%;
  height: 1140px;
  border: none;
  overflow: hidden;
  display: block;
}
table {
  width: 100%;
}
<center>
  <table border="0">
    <tr>
      <td>
        <iframe class="TbRH" src="teste/teste.PDF"></iframe>
      </td>
    </tr>
  </table>
</center>

I believe that solves.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.