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