I'm trying to load an iFrame into a Wordpress website. The iFrame should load the table displayed in this link, with all the colors and other styles applied.
However, when I insert the iFrame on my website, it will load the content of the table but not the CSS.
This is how I tried to 'force' load the right CSS, as I suspect the Wordpress theme is overriding the Table CSS:
<script language="javascript" type="text/javascript"> function iFrameHeight() { var h = 0; if (!document.all) { h = document.getElementById('blockrandom').contentDocument.height; document.getElementById('blockrandom').style.height = h + 60 + 'px'; } else if (document.all) { h = document.frames('blockrandom').document.body.scrollHeight; document.all.blockrandom.style.height = h + 20 + 'px'; var cssLink1 = document.createElement("link"); cssLink1.href = "https://www.gscris.it/lmo/lmo-style.css"; cssLink1.rel = "stylesheet"; cssLink1.type = "text/css"; frames['iframe'].document.head.appendChild(cssLink1); var cssLink2 = document.createElement("link"); cssLink2.href = "https://www.gscris.it/lmo/lmo-style-nc.css"; cssLink2.rel = "stylesheet"; cssLink2.type = "text/css"; frames['iframe'].document.head.appendChild(cssLink2); } } </script> <div>Campioni d'amicizia</div> <iframe onload="iFrameHeight()" id="blockrandom" name="iframe" src="https://www.gscris.it/lmo/lmo.php?todo=&file=Piccamici201819.l98" width="100%" height="600" scrolling="no" align="top" frameborder="0"> Questa scelta non funziona correttamente in quanto il browser utilizzato non supporta gli Inline Frames </iframe> What am I doing wrong? This is my website page where the iframe is inserted (scroll to the bottom).