0

I have added the following css to the body of IFrame but it is not working, I also tried it with jQuery but no success.

I found that it can't be added with cross domain and found a Solution but that didn't work

Here is the code I tried

.cal iframe html body {
    overflow:hidden;
}

Here is the code I tried with JQUery

 $("#myiFrame").on("load", function() {
  let body = $("#myiFrame").contents().find("body");
  let css = '<style>/********* Put your styles here **********</style>';
  $(body).append(css);
});
Engr Umair
  • 130
  • 10
  • Can this answer at this question? https://stackoverflow.com/questions/583753/using-css-to-affect-div-style-inside-iframe – xKobalt Mar 05 '20 at 08:53
  • You cannot amend the CSS of the iframe content from the parent page using CSS. You can use JS to do this, however it depends on the source of the iframe. Is it on the same domain as the parent window? – Rory McCrossan Mar 05 '20 at 09:02
  • @xKobalt yes I got some people say it only possible if parent is from same domain but in my case iframe comes from another domain – Engr Umair Mar 05 '20 at 09:25

0 Answers0