Let's say i have an iframe with the page 2.htm set as the src.
<iframe src="2.html"></iframe>
So this shows the 2.html. But 2.html has a div with the id 'within'. I want to only display the contents of 'within'.
How would i do this?
Let's say i have an iframe with the page 2.htm set as the src.
<iframe src="2.html"></iframe>
So this shows the 2.html. But 2.html has a div with the id 'within'. I want to only display the contents of 'within'.
How would i do this?
 
    
    This is the CSS and html code to accomplish the task:
<style>
#outerdiv
{
   width:446px;
   height:246px;
   overflow:hidden;
   position:relative;
}
#inneriframe
{
   position:absolute;
   top:-412px;
   left:-318px;
   width:1280px;
   height:1200px;
}
</style>
<div id="outerdiv">
    <iframe src="2.html" id="inneriframe" scrolling="no"></iframe>
</div>
Try this out: http://jsfiddle.net/57MRn/
How does this work
The iframe is moved up within the outerdiv until only the within div is shown.
 
    
    