Jump to content

Iframe Styling


djp1988

Recommended Posts

Hi, I remember seeing a website that styled an iframe (500pixels by 300pixels) so that in the area visible of the iframe, appeared a certain part of the iframe document.But I can't find how to do this.So I want to show another site's page, but I want to omit their top banner and their navigation from the left so the person on my page only sees the content area from their page, can i do this with css / iframe attributes?

Link to comment
Share on other sites

You don't have access to the content of an iframe (or any frame, for that matter) if the page is not in the same domain as the parent window.

Link to comment
Share on other sites

this seems to hide the top of the page shown in the iframe, to hide a banner.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>auto iframe height adjust</title><style></style><script type="text/javascript"><!--//function sizeFrame(frameId) { var F = document.getElementById(frameId); if(F.contentDocument) { F.height = F.contentDocument.documentElement.scrollHeight+30; //FF 3.0.11, Opera 9.63, and Chrome F.contentDocument.documentElement.style.marginTop="-200px"; } else { F.height = F.contentWindow.document.body.scrollHeight+30; //IE6, IE7 and Chrome F.contentWindow.document.body.style.marginTop="-200px"; } }// window.onload=sizeFrame; //--></script></head><body><iframe width="100%" id="myFrame" src="externalpage.htm" scrolling="no" frameborder="0" onload="sizeFrame('myFrame')">An iframe capable browser isrequired to view this web site.</iframe></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...