【发布时间】:2019-02-08 23:33:36
【问题描述】:
我有一个 iframe,它位于页面左对齐的 div 中(仅在大屏幕上,然后它下降到下方并且应该与屏幕一样宽)。我希望 iframe 在屏幕较小时缩小以按比例缩小。目前,它只是切断框架。
这就是我所拥有的
我的html:
<div id="top_right">
<iframe id="forecast_embed" type="text/html" height="250" width="100%" frameborder="0" [src]='mylink'> </iframe>
</div>
我的 CSS:
@media only screen and (max-width: 1000px) {
iframe {
display:block;
width:100%;
}
#top_right_div {
width: 100%;
display: inline-block;
/* height: 260px; */
}
}
@media only screen and (min-width: 1000px) {
iframe {
display:block;
width:100%;
}
#top_right_div {
width: 40%;
display: inline-block;
/* height: 260px; */
}
}
只是不知道从这里去哪里。谢谢
【问题讨论】:
标签: html css iframe responsive-design