簡體   English   中英

根據 Iframe 寬度/高度調整 Iframe 內容

[英]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>

您應該嘗試使用heightwidth和 scale 值來達到您想要的結果。

另請參閱: 調整外部網站內容大小以適合 iFrame 寬度

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM