首页 > 解决方案 > 我怎样才能使我的内容 iframe 响应?

问题描述

我有一个问题,我无法调整 iframe 的大小以完全响应(我的意思是,内容!)

<iframe src="https://www.meteoblue.com/fr/meteo/widget/three/saint-jean-de-braye_france_2979341?geoloc=fixed&nocurrent=0&noforecast=0&days=4&tempunit=CELSIUS&windunit=KILOMETER_PER_HOUR&layout=image"  frameborder="0" scrolling="NO" allowtransparency="true" sandbox="allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox" style="width: 460px;height: 594px">

标签: javascripthtmlcss

解决方案


这样做

.iframe-container{
max-width:700px;
width:100%;
margin:0 auto
}
<div class="iframe-container">
<iframe src="https://www.meteoblue.com/fr/meteo/widget/three/saint-jean-de-braye_france_2979341?geoloc=fixed&nocurrent=0&noforecast=0&days=4&tempunit=CELSIUS&windunit=KILOMETER_PER_HOUR&layout=image"  frameborder="0" scrolling="NO" allowtransparency="true" sandbox="allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox" style="width: 100%;height: 594px"></iframe>
</div>


推荐阅读