how to add CSS in this iframe

2019-06-02 19:37发布

问题:

Can any one tell me how I can add my own CSS in an external site page through an iframe. So what code should I change here:

<iframe src="http://dhost.info/asz/demo.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="232px" width="514px" id="Dir-go" allowtransparency="true" title="WebDir"></iframe>

回答1:

You can't. Nor can you add a stylesheet to it though Javascript. You can't edit the DOM of another domain's Iframe. (Very secure and all.)



回答2:

External domains Iframes you cannot do anything but, internal iframes (using own domain) you can do this by using DOM javascript.



标签: css iframe frame