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 s开发者_如何转开发till 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 ?
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"?
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...
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.
精彩评论