views:

74

answers:

2

I need to load a page with an iframe in a way that its header is hidden. I tried the following but for some reason it isn't working:

<div style="width:945px; height:600px; overflow:hidden;"> 
    <iframe src="innerpage.html" 
        frameborder="0" 
        height="700" 
        scrolling="no" 
        width="945"  
        style="top:-100px" /> 
</div>
A: 

It isn't working because you can't style the inside of an iframe from the parent, without accessing the document inside whether from the parent's javascript, or a stylesheet inside the iframe assuming said iframe is on the same domain as yours.

meder
A: 

What meder said is true, but it could also be that your style wouldn't do anything. You'll need to set position: absolute or position: static in order for top to have any impact.

This will just move the whole iframe up though, not the content within the iframe.

idrumgood
the style would apply to the iframe, not the contents of the iframe.
meder
unless i'm mistaken in that he wants to actually position *the* iframe, not the contents.
meder