html - How to apply CSS to iframe? -


i have simple page has iframe sections (to display rss links). how can apply same css format main page page displayed in iframe?

edit: not work cross domain unless appropriate cors header set.

there 2 different things here: style of iframe block , style of page embedded in iframe. can set style of iframe block usual way:

<iframe name='iframe1' id="iframe1" src="empty.htm"          frameborder="0" border="0" cellspacing="0"         style="border-style: none;width: 100%; height: 120px;"></iframe> 

the style of page embedded in iframe must either set including in child page:

<link type="text/css" rel="stylesheet" href="style/simple.css" /> 

or can loaded parent page javascript:

var csslink = document.createelement("link"); csslink.href = "style.css";  csslink.rel = "stylesheet";  csslink.type = "text/css";  frames['frame1'].document.body.appendchild(csslink); 

Comments

Popular posts from this blog

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -