[英]Resize Iframe content according to Iframe Width/Height
如何調整 iframe 內容的大小以填充 Iframe 的寬度/高度?
我已經更改了 Iframe 的寬度和高度以使其更大,但是內容不會隨其縮放,從而留下一堆空白(就像內容絕對位於 iframe 的左上角一樣)。
<iframe width="500px" height="300px" frameborder="0"
scrolling="no" src="someContent">
</iframe>
為什么設置 iframe 的寬度/高度時 iframe 的內容不縮放?
如果您無法控制 iframe 的內容(即您無法編輯源代碼),您可以嘗試縮放 iframe,如下所示:
<iframe width="500px" height="300px" frameborder="0"
scrolling="no" src="someContent"
style="-webkit-transform:scale(0.5);-moz-transform-scale(0.5);">
</iframe>
您應該嘗試使用height
、 width
和 scale 值來達到您想要的結果。
另請參閱: 調整外部網站內容大小以適合 iFrame 寬度
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.