Jump to content

Iframe Styling


djp1988
 Share

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...