Stefan Steiger
Stefan Steiger

Reputation: 82196

Div in screen center when there are frames?

How can I place a div into the SCREEN (not page) center,
when the div is in an iframe,
and the div's x position for being in the SCREEN center is
too far left for still being on the iframe page (div.x < iFramePage.x) ?



The iframe is in a table in the right row, and in the left row there is a navigation treeview.
Now my div should overlap the treeview, for being in the center...

How can I do that ?

Upvotes: 2

Views: 432

Answers (3)

Veera
Veera

Reputation: 33182

As Mef and Valamo answerd, it's not possible to align the div in center of the page which is inside an iframe. Instead of doing this, you can consider moving the div to the parent document (which contains the iframe) and you can align the div as you want.

Upvotes: 1

Leo
Leo

Reputation: 38190

You can't. The contents of an iframe will never be able to "leave" the frame, instead, the iframe will get scrollbars.

No offense, but this sounds like a poor site architecture anyways. Maybe you should have a look at (lightweight) content management systems. Having that said, maybe you have a very very grace reason for this "architecture"?

Upvotes: 4

Tor Valamo
Tor Valamo

Reputation: 33749

You can't. That would defy the point of an iframe. And it could also be used to display ads outside of the box in which they paid to be displayed. And nobody wants that, do they...

Upvotes: 1

Related Questions