【发布时间】:2015-02-24 22:45:27
【问题描述】:
我已经看到了有关视频的解决方案,但都没有奏效。我引入的 iframe 是房地产,虽然我的网站是响应式的,但 iframe 不是。我的网站是一个 Wordpress 网站。
这里是我现在的代码:
.property {
position: relative;
padding-bottom: 75%;
height: 0;
overflow: hidden;
}
.property iframe {
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}
所以我在一个 div 中有一个 iframe,它有一个名为“property”的类。我的理解是 iframe 应该随着包装器 div 'property' 的宽度而扩展和收缩,但情况似乎并非如此。如果需要,我很乐意提供网址。
【问题讨论】:
-
添加后尝试 max-width: 100%;在“.property iframe”中
-
调整 iframe 元素本身的大小并不一定意味着其中的内容会自动执行相同的操作……
-
不,那没用。