JSFiddle - React, Tailwind, and code Playground
by Daniele Cedro
HTML
<div id="frame_app">
<iframe src="http://demo.consulenzait.it/cms_trasparenza/default.aspx?0*0*0*1" id="app" name="app" ></iframe></div>
CSS
#frame_app {
position: relative;
padding-bottom: 65.25%;
padding-top: 30px;
height: 0;
overflow: auto;
-webkit-overflow-scrolling:touch;
border: 0 none;
}
#frame_app iframe {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
border: 0;
}
#frame_app iframe html body {border: 10px solid red !important;}
JavaScript
$(window).load(function () {
var frame = $('iframe').get(0);
if (frame != null) {
var frmHead = $(frame).contents().find('head');
if (frmHead != null) {
// frmHead.append($('style, link[rel=stylesheet]').clone()); // clone existing css link
frmHead.append("<link/>", { rel: "stylesheet", href: "http://demo.consulenzait.it/Repository/Demo/Upload/2015/id_56/style_app.css", type: "text/css" }); // or create css link yourself
}
}
});
/*var $iframe = $('#app');
$iframe.ready(function() {
$iframe.contents().find("head").append("<link rel='stylesheet' href='http://demo.consulenzait.it/Repository/Demo/Upload/2015/id_56/style_app.css'>");
});*/
/*$(document).ready( function () {
$('#app').load( function () {
$('this').contents().find("head").append('<link rel="stylesheet" href="http://demo.consulenzait.it/Repository/Demo/Upload/2015/id_56/style_app.css" />');
});
});*/
/*$('body',app.document).append('<link rel="stylesheet" href="http://demo.consulenzait.it/Repository/Demo/Upload/2015/id_56/style_app.css" />');*/
/*$("#app").load(function (){
$('this').contents().find("html").append("<link rel='stylesheet' href='http://demo.consulenzait.it/Repository/Demo/Upload/2015/id_56/style_app.css'>")
});*/
//$('#include-from-outside').load('http://demo.consulenzait.it/cms_trasparenza/default.aspx?0*0*0*1');
/*var cssLink = document.createElement("link")
cssLink.href = "style.css";
cssLink .rel = "stylesheet";
cssLink .type = "text/css";
frames['app'].document.body.appendChild(cssLink);*/