0

I am trying to show a stackOverflow page through the iframe but it is not working.

<iframe
    title="page in a page"
    width="300"
    height="200"
    src="https://stackoverflow.com/questions/65987297/bi-directional-css-height-animation">
</iframe>

Some solutions on internet are saying to remove https: from the url then it will work. But it is also not working for me.

0

1 Answer 1

0

Many websites do not allow being rendered inside iFrames for security reasons. This is the case here as well with stackoverflow. You can see that in the response headers of the requested page:

x-frame-options: SAMEORIGIN

You can read more about x-frame-options for example on MDN.

4
  • then t means I can't show that page in an iframe ? Feb 3, 2021 at 14:44
  • that is correct, to be precise: the browser is instructed by the page (in this case stackoverflow) to not allow loading that url in an iframe. Feb 3, 2021 at 14:46
  • okay thanks for help. I think PHP can do this easily by using file_get_contents. Feb 3, 2021 at 14:53
  • I can't answer this question because it is closed now. Feb 3, 2021 at 14:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.