Javascript Can';不加载iFrame CSS

Javascript Can';不加载iFrame CSS,javascript,html,css,iframe,Javascript,Html,Css,Iframe,我正在尝试将iFrame加载到Wordpress网站。 iFrame应加载中显示的表格,并应用所有颜色和其他样式 但是,当我在我的网站上插入iFrame时,它将加载表的内容,但不会加载CSS 这就是我试图“强制”加载正确CSS的方式,因为我怀疑Wordpress主题正在覆盖表CSS: <script language="javascript" type="text/javascript"> function iFrameHeight() { var h = 0; if (!d

我正在尝试将iFrame加载到Wordpress网站。 iFrame应加载中显示的表格,并应用所有颜色和其他样式

但是,当我在我的网站上插入iFrame时,它将加载表的内容,但不会加载CSS

这就是我试图“强制”加载正确CSS的方式,因为我怀疑Wordpress主题正在覆盖表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>

函数iframehight(){
var h=0;
如果(!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(“链接”);
cssLink1.href=”https://www.gscris.it/lmo/lmo-style.css";
cssLink1.rel=“样式表”;
cssLink1.type=“text/css”;
frames['iframe'].document.head.appendChild(cssLink1);
var cssLink2=document.createElement(“链接”);
cssLink2.href=”https://www.gscris.it/lmo/lmo-style-nc.css";
cssLink2.rel=“样式表”;
cssLink2.type=“text/css”;
frames['iframe'].document.head.appendChild(cssLink2);
}
}
阿米齐亚钟楼酒店
QUASTA scelta quanto il浏览器中的非funziona correttamente用于非支持gli直列帧
我做错了什么?
这是插入iframe的位置(滚动至底部)。

使用HTTPS在iframe中提供css服务。如果打开Chrome Devtools,可以多次看到以下错误消息:
混合内容:“”处的页面是通过HTTPS加载的,但请求了不安全的图像“”。此内容也应通过HTTPS提供。

首先,iFrame不会使用外部css。因为它们有自己的html头和体标记,所以它是一个单独的html文档。不能替代Iframe中的任何样式。相反,您可以尝试将样式表附加到所需的文档中,并在iframe中使用。

噢,感谢您对我的疑问所作的澄清。然而,我很有信心的根本问题是,我尝试导入的CSS不使用HTTPS,将尝试修复此问题,并将尽快更新,这应该是原因,现在尝试,将让您知道