我正在尝试为 iframe 中的内容应用 CSS 样式,请查看此链接http://jsfiddle.net/pPqGe/
jQuery:
$(document).ready(function() {
$('iframe').contents().find('h1').css('color','red');
});
HTML:
<iframe src="mysite" width="100%" height="100%" id="myframe"></iframe>
对于 iframe 源,我使用了一个实时网站。