Home >Web Front-end >HTML Tutorial >How to change font size of inline frames externally_html/css_WEB-ITnose

How to change font size of inline frames externally_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 12:20:401559browse

HTML frame font JavaScript

100db36a723c770d327fc0aef2ce13b1
4310665581d5661129c8a14df5ee0edf
4ec11beb6c39d0703d1751d203c17053
function changeFontSize(size){
var doc = document.getElementsByTagName('body')[0];
doc.style.fontSize = size "px";
}
2cacc6d41bbb37262a98f745aa00fbf0
2ca9cda82d2c41c7e54610cc59d7a8aaA5db79b134e9f6b82c0b36e0489ee08ed
bc2a566bc8b08707de5a17a2835975efA5db79b134e9f6b82c0b36e0489ee08ed
ad6590861301f2fb2f9299f56e7e487cThis text will change size immediatelyc006126ef8c3738847df22976e4c0fc2
065276f04003e4622c4fe6b64f465b88
36cc49f0c466276486e50c850b7e4956
73a6ac4ed44ffec12cee46588e518a5e
This cannot change the font size in the inline frame. How can I change the font size in the inline frame?

Reply to discussion (solution)

<html><body bgcolor="#fffff"><script type="text/javascript">    function changeFontSize(size) {        var bd = document.getElementById('ifr').contentWindow.document.body;        bd.style.fontSize = size + "px";    }</script><a href="javascript:changeFontSize(14)" style="font-size:14px;" alt="Smaller Font Size">A</a><a href="javascript:changeFontSize(18)" style=" font-size:18px;" alt="Larger Font Size">A</a><div id=zoom>这段文字会随即改变大小</div><iframe id="ifr" src="2.html" height="500" width="999" align="center" scrolling="no" marginwidth="80" vspace="100"></iframe></body></html>

ok OK Thank you very much!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn