Forum Moderators: open
I've read up on IFrame's but I'd like to know what code would be necessary to be included into the IFrame to allow control of where the IFrame displays relative to the target page.
For example, I have a page called "Page1", and I create an IFrame on "Page1" to display "Page2" in the center of "Page1". But the IFrame will display the upper left portion of "Page2" in the IFrame, and I'd like to move it to display the lower portion on "Page2" within the IFrame window shown on "Page1".
What code would need to be added to this to accomplish this?
<iframe src="Page2" width="100"
height="400" frameborder="0"
style="height:7.8em" scrolling="no"
marginwidth="0" marginheight="0">
</iframe>
I'm not to sure what the "em" stands for in the style="height:7.8em" .
Thanks!
Mike
<a name="spot"></a>
And then point your src attribute right at it
src="page2.html#spot"
On the "em" question, 1 em is the height of the font that is set in the parent or containing object - in many cases that will be the default font size set for <body> in the browser doing the rendering.
So in this case, your iframe is set to be 7.8 lines high. That kind of a declaration can be chosen to make sure that an exact amount of information is displayed, no matter what font size the user set for their browser default.
Just to clarify what I'm trying to do. I'm a rookie web designer, and I don't know PHP 4 at all. I have a cool Poll script installed, and they show up on a .php page. I'd like to get the poll to show up in my regular html text pages. So the IFrame seemed to be a good, easy way to go.
Looking at your iframe code again, the height gets declared twice - once it's 400px and then the style tag overwrites it with that 7.8 em. You should probably pick one or the other.