2017-06-19 31 views
0

我想自动调整高度以获取其所在网站的内容。我也尝试过使用iframe。我已经阅读并尝试了从这里的代码示例,CSS和JS脚本的LOT,但没有任何帮助。嵌入对象标签中的自动高度

在此先感谢丹。

这是我的代码。

<object type="text/html" data="https://iloapp.learningknots.com/blog/blog?Home#niceURL" style="width:850px; height:2100px;"> 
<embed src="https://iloapp.learningknots.com/blog/blog?Home#niceURL"></embed> 
Error: Embedded data could not be displayed.</object> 

你可以看看它是如何看起来像我的网站在这里:my website

回答

0

甲肝DIV容器,连锁行业ID的。

HTML

<div class="responsive-object"> 
    <object id="objid" type="text/html" data="https://iloapp.learningknots.com/blog/blog?Home#niceURL"> 
    <embed id="thissite" src="https://iloapp.learningknots.com/blog/blog?Home#niceURL"></embed> 
    Error: Embedded data could not be displayed.</object> 
</div> 

CSS

.responsive-object { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
} 

#thissite { 
    height: 100%; 
    width: 100%; 
} 

#objid { 
    height: 100%; 
    width: 100%; 
} 

小提琴

.responsive-object { 
 
    position: absolute; 
 
    top: 0; 
 
    left: 0; 
 
    width: 100%; 
 
    height: 100%; 
 
} 
 

 
#thissite { 
 
    height: 100%; 
 
    width: 100%; 
 
} 
 

 
#objid { 
 
    height: 100%; 
 
    width: 100%; 
 
}
<div class="responsive-object"> 
 
    <object id="objid" type="text/html" data="https://iloapp.learningknots.com/blog/blog?Home#niceURL"> 
 
    <embed id="thissite" src="https://iloapp.learningknots.com/blog/blog?Home#niceURL"></embed> 
 
    Error: Embedded data could not be displayed.</object> 
 
</div>

+0

我仍然应该在objeckt标签中使用style(height:1200px)标签吗?编辑 –

+0

,看看这是你想要的。 – Hash

+0

哈希,它不工作。抱歉。我认为。难道是,即时通讯使用https? –