[HTML]如何設定iframe內容的顯示比例
發表於 : 2010年 6月 3日, 12:43
一般在 iframe 進來的網頁內容, 有時希望顯示的比例做些調整, 以符合原網頁及 iframe 進來的網頁的顯示比例, 這時候可以利用 iframe 的 css 屬性來調整顯示比例, 操作方式如下:
inline方式:
或是css方式:
其中的 zoom: 0.8 是 for ie8 使用的 css 的 extension, 而 -moz 的就是 for firefox 使用的.
參考資料:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://stackoverflow.com/questions/1661 ... -of-iframe
inline方式:
代碼: 選擇全部
<iframe id="myiframe" style="zoom: 0.8; -moz-transform: scale(0.8); -moz-transform-origin: 0 0;" width=320 height=240 src="http://bbs.diary.tw/aa.htm"></iframe>代碼: 選擇全部
<style>
#myiframe { zoom: 0.8; -moz-transform: scale(0.8); -moz-transform-origin: 0 0; }
</style>
....
<iframe id="myiframe" width=320 height=240 src="http://bbs.diary.tw/aa.htm"></iframe>
參考資料:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://stackoverflow.com/questions/1661 ... -of-iframe